Jump to content


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.
Photo

Updating Local Security Settings->Localpolicies


1 reply to this topic

vPanchumarthi

vPanchumarthi
  • Full Members
  • 56 posts

Posted 08 October 2009 - 14:02

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

Attached Images

  • logon_as_a_service.JPG


smc0862

smc0862
  • Full Members
  • 54 posts

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

Edited by smc0862, 20 October 2009 - 11:16.