Add Domain users to group
Hi,
Can someone help me with problem which i have, and the problem is that i cannot join domain users using script:
Set oWshNet = CreateObject("WScript.Network" )
Set oShell = Wscript.CreateObject("Wscript.Shell")
sUser = oShell.ExpandEnvironmentStrings("%USERNAME%")
sNetBIOSDomain = oWshNet.UserDomain
sComputer = oWshNet.ComputerName
Set oGroup = GetObject("WinNT://" & sComputer & "/DB2USERS,group" )
Set oUser = GetObject("WinNT://" & sNetBIOSDomain & "/" & sUser & ",user" )
' suppress errors in case the user is already a member
If (oGroup.IsMember(oUser.ADsPath) = False) Then oGroup.Add(oUser.ADsPath)End If
On Error Goto 0
to a group, if i dissable UAC and add user admin rights then it works but that is not solution for me, so I`m asking you guys have any one met with a problem like my, coz everything works on XP but i need the same to work on Win 7.
plaes help!
Can someone help me with problem which i have, and the problem is that i cannot join domain users using script:
Set oWshNet = CreateObject("WScript.Network" )
Set oShell = Wscript.CreateObject("Wscript.Shell")
sUser = oShell.ExpandEnvironmentStrings("%USERNAME%")
sNetBIOSDomain = oWshNet.UserDomain
sComputer = oWshNet.ComputerName
Set oGroup = GetObject("WinNT://" & sComputer & "/DB2USERS,group" )
Set oUser = GetObject("WinNT://" & sNetBIOSDomain & "/" & sUser & ",user" )
' suppress errors in case the user is already a member
If (oGroup.IsMember(oUser.ADsPath) = False) Then oGroup.Add(oUser.ADsPath)End If
On Error Goto 0
to a group, if i dissable UAC and add user admin rights then it works but that is not solution for me, so I`m asking you guys have any one met with a problem like my, coz everything works on XP but i need the same to work on Win 7.
plaes help!
0 Comments
[ + ] Show comments
Answers (2)
Please log in to answer
Posted by:
anonymous_9363
13 years ago
Ahhhhhhhhhh...the joys of IBM's DB2 LOL.
You can - and should - avoid the requirement to create the local groups and users if you run a command line to tell it to use domain accounts and groups. Unfortunately, I can't recall what that command line is but it's documented on IBM's web site. Somewhere...
You can - and should - avoid the requirement to create the local groups and users if you run a command line to tell it to use domain accounts and groups. Unfortunately, I can't recall what that command line is but it's documented on IBM's web site. Somewhere...
Posted by:
lanselots
13 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.