Recently Browsing 0 members
No registered users viewing this page.
Hope you are doing fine by the time being :/
Well, seems that I'm running into an issue while trying to add an Active domain security group to a remote computer that has a space in it.
I've been searching for quite a while now and seems that my search did not get well.
The ideal solution for me would be to use Psexec.exe as I can run it with my admin credentials whereas using WMIServices, I don't know how to launch that with these credentials.
Here's what I wrote so far:
$sADGroupName as a space in it and there's nothing I can do about, we have to respect a naming convention but it would be "Admins REMOTEMACHINENAME"
Func f_AddADGroup2localAdmin() SplashTextOn("", "Adding " & $sADGroupName & " to the Local Administrators Group.", 1000, 100, -1, -1, 33, -1, -1, 700) $sCommand = $sResources & 'PsExec -accepteula \\' & $sServName & ' net localgroup Administrators MYDOMAIN\"' & $sADGroupName & '" /add' RunAsWait($sTechGID, "MYDOMAIN", $sTechPWD, 4, $sCommand, @SW_SHOW) SplashOff() ; f_MoveADObject() End Func What is weird is when I output the $sCommand variable, the space is in here but it seems not to be passed in my psexec command when I run it.
Another thing I saw is that 4 times out of 10, psexec does not even launch.
So I was also wondering if there could be another way to add the "spaced" group with my admin credentials on a remote server other than psexec.
Thanks all in advance for the lights you may provide to me and keep safe!