During my Deployment of Windows 7 within my Task Sequence I would like to add a popup-prompt where I can type in a domain username.
And the domain user I type in will be added to the local Administrator Group.
I did find something on google, but I´m not able to get rid of why it isnt working. Anyone out there who have an idea?
/Johnson
domain = InputBox("What is the Domain name?")
myUser = InputBox _
("What NT LOGON NAME do you wish to add to the Local Administrator Group?")
strDomainGroup = "WinNT://" & domain & "/" & myGroup & ",group"
Set objDomainGroup = GetObject(strDomainGroup)
Set objNetwork = CreateObject("Wscript.Network")
strComputer = objNetwork.ComputerName
Set objLocalGroup = GetObject("WinNT://" & strComputer _
& "/Administrators,group")
If Not objLocalGroup.IsMember(objDomainGroup.AdsPath) Then
objLocalGroup.Add(objDomainGroup.AdsPath)
End If
strDomainUser = "WinNT://" & domain & "/" & MyUser & ",user"
Set objDomainUser = GetObject(strDomainUser)
Set objNetwork = CreateObject("Wscript.Network")
strComputer = objNetwork.ComputerName
Set objLocalGroup = GetObject("WinNT://" & strComputer _
& "/Administrators,group")
If Not objLocalGroup.IsMember(objDomainUser.AdsPath) Then
objLocalGroup.Add(objDomainUser.AdsPath)
end IF
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.
Hi.
During my Deployment of Windows 7 within my Task Sequence I would like to add a popup-prompt where I can type in a domain username.
And the domain user I type in will be added to the local Administrator Group.
I did find something on google, but I´m not able to get rid of why it isnt working. Anyone out there who have an idea?
/Johnson
Share this post
Link to post
Share on other sites