Batch file Fails when deployed with SMS 2.0
I have a command to add the currently logged on user to the Local Administrator's group using a bacth file.
the command I am using is NET LOCALGORUP ADMINISTRATORS %USERNAME% /add which works fine when I run on the local system. However once it gets into SMS, the application fails to execute despite running with Administrative Priv. I have also attempted to execute it with the Windows NT Client Software Installation account all to no avail.
Please does any1 know how to get around such problems in SMS.
the command I am using is NET LOCALGORUP ADMINISTRATORS %USERNAME% /add which works fine when I run on the local system. However once it gets into SMS, the application fails to execute despite running with Administrative Priv. I have also attempted to execute it with the Windows NT Client Software Installation account all to no avail.
Please does any1 know how to get around such problems in SMS.
0 Comments
[ + ] Show comments
Answers (6)
Please log in to answer
Posted by:
kkaminsk
20 years ago
Yeah it's definately going to fail if it's using the service account to install software.
I dunno if this wold work:
' -Start
' Get Currently Logged-On User details
Set sysinfo = CreateObject("ADSystemInfo")
Set oUser = GetObject("LDAP://" & sysinfo.UserName & "")
msgbox sysinfo.username
msgbox oUser.telephonenumber
wscript.quit
' -End
Or maybe this?
http://cwashington.netreach.net/depo/view.asp?Index=750&ScriptType=rexx
Honestly I'm guessing here so maybe someone else can help out better than me.
I dunno if this wold work:
' -Start
' Get Currently Logged-On User details
Set sysinfo = CreateObject("ADSystemInfo")
Set oUser = GetObject("LDAP://" & sysinfo.UserName & "")
msgbox sysinfo.username
msgbox oUser.telephonenumber
wscript.quit
' -End
Or maybe this?
http://cwashington.netreach.net/depo/view.asp?Index=750&ScriptType=rexx
Honestly I'm guessing here so maybe someone else can help out better than me.
Posted by:
oofemioo
20 years ago
Posted by:
oofemioo
20 years ago
Posted by:
kkaminsk
20 years ago
Ok, I needed some coffee and a good meal to get the ol brain fired up. I looked at VBScript and I don't think there is a straight forward way to do it. The easiest way I think you can find it out is check the HKLM\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\AltDefaultUserName value. Then you can use that to batch file or vbscript. Otherwise there might be a way to do it in WMI but it'll likely be more painful.
Posted by:
oofemioo
20 years ago
Posted by:
oofemioo
20 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.