/build/static/layout/Breadcrumb_cap_w.png

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.

0 Comments   [ + ] Show comments

Answers (6)

Posted by: kkaminsk 20 years ago
9th Degree Black Belt
0
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.
Posted by: oofemioo 20 years ago
Blue Belt
0
Many thanks. I've been waiting here all day for someone to reply.
This package has been on my desk for 3 weeks and I've decided to install whilst upgrading user accounts to Local Administrator.

Which other account can I run it with? I am running as an Administrator from the SMS Console.
Posted by: oofemioo 20 years ago
Blue Belt
0
The script displays the currently logged on user fullnames, OU & DC.
Is there any other script I can use to add the user to the Local Admin Group?

Cheers
Posted by: kkaminsk 20 years ago
9th Degree Black Belt
0
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
Blue Belt
0
Does any1 know Windows commands that cant be used in batch files when deploying via SMS.

I ve noticed commands such as NET LOCALGROUP not working when deployed via SMS 2.0.

Is there any official documentation or information on this?

Many thanks.
Posted by: oofemioo 20 years ago
Blue Belt
0
Although I dont need this solution on my current project. I was faced with the dilemma whilst deploying some batch files with SMS.

Does any1 know how to solve such problem?
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ