Afficher un message
Vieux 26/09/2007, 08h57   #3
Chris
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: VBS to create local user and add to local amins

Thanks Lads.

Very Much Appreciated.


"Richard Mueller [MVP]" <rlmueller-nospam@ameritech.nospam.net> wrote in
message news:uNS1Xw7$HHA.3548@TK2MSFTNGP06.phx.gbl...
>
> "Fred Beck" <FredBeck@discussions.microsoft.com> wrote in message
> news:E50D755D-593F-46F2-AA91-FB0E98A6160E@microsoft.com...
>> The "." signifies the machine that you are running the script on.
>>
>> strComputer = "."
>> Set objGroup = GetObject("WinNT://" & strComputer & "/Administrators")
>> Set objUser = GetObject("WinNT://fabrikam/kenmyer")
>> objGroup.Add(objUser.ADsPath)

>
> A script can also retrieve the NetBIOS name of the local computer from the
> wshNetwork object:
> ========
> Set objNetwork = CreateObject("Wscript.Network")
> strComputer = objNetwork.ComputerName
>
> Set objComputer = GetObject("WinNT://" & strComputer)
> Set objUser = objComputer.Create("user", "NewUser")
> objUser.SetInfo
> ========
> But the "." probably works as well.
>
> --
> Richard Mueller
> Microsoft MVP Scripting and ADSI
> Hilltop Lab - http://www.rlmueller.net
> --
>
>



  Réponse avec citation
 
Page generated in 0,05425 seconds with 9 queries