Hi,
At the time of installation , I want add user details(user id taken from UI) in Log on as a service (Local Security Settings (secpol.msc)->LocalPolicies->UserRightsAssignment->Log on as a service.
Can anybody suggest any script available to modify the Local policy settings in Local Security Settings (secpol.msc).
Please find the attached screenshot as a reference
This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Updating Local Security Settings->Localpolicies
Started by
vPanchumarthi
, Oct 08 2009 14:02
1 reply to this topic
Posted 20 October 2009 - 11:14
Here's how I do this in our installers. This uses a VBScript action and the NTRIGHTS.EXE utility.
I added the ntrights.exe utility to the installer in the 'Support Files' section. Then I execute the follow VBScript custom action.
On Error Resume Next
' Now grant the Service Logon Right.
sUser = Session.Property("USER_FROM_DIALOG")
sSupportDir = Session.Property("SUPPORTDIR")
sExe = """" &sSupportDir & "\NTRIGHTS.EXE"""
Set ws = CreateObject ("WSCript.shell")
ws.Run sExe & " -u " & sUser & " +r SeServiceLogonRight", 0, True
Set ws = Nothing
Hope this helps.
-Shawn
I added the ntrights.exe utility to the installer in the 'Support Files' section. Then I execute the follow VBScript custom action.
On Error Resume Next
' Now grant the Service Logon Right.
sUser = Session.Property("USER_FROM_DIALOG")
sSupportDir = Session.Property("SUPPORTDIR")
sExe = """" &sSupportDir & "\NTRIGHTS.EXE"""
Set ws = CreateObject ("WSCript.shell")
ws.Run sExe & " -u " & sUser & " +r SeServiceLogonRight", 0, True
Set ws = Nothing
Hope this helps.
-Shawn
Edited by smc0862, 20 October 2009 - 11:16.