|
|
Question : How to grant user administrator privilage on the pc using group policy?
|
|
We have over 200 users that log in to the domain, how do we grant them access to install a program without visiting the pc and logging in with administrator privilege?
|
Answer : How to grant user administrator privilage on the pc using group policy?
|
|
Try this - but test it with only one or two computers in C:\Computers.txt The hurdle I found was identifying what users were added so that they could be removed later (I'll post that script shortly).
If you're only doing one system, there's a script online that's perfect for this, if you know the exact user - because it grants admin access for a period of time (it's on a timer before they get removed). Unfortunately that won't work here, so it requires 'two' scripts...here's the first one...
'AddAdmins.vbs Dim objFSO: Set objFSO = CreateObject("Scripting.FileSystemObject") Dim objOutput: Set objOutput = objFSO.CreateTextFile("C:\AdminReport.txt")
arrComputers=Split(objFSO.OpenTextFile("C:\Computers.txt").ReadAll, vbNewLine)
For Each PC in arrComputers Set objAdmin = GetObject("WinNT://" & PC & "/Administrators") Set objUser = GetObject("WinNT://" & PC & "/Users") For Each usr In objUser.Members If InStr(LCase(usr.AdsPath), "authority") = 0 Then objOutput.WriteLine objAdmin.AdsPath & "," & usr.Name objAdmin.Add (usr.AdsPath) End If Next Next
objOutput.Close Set objOutput=Nothing Set objFSO=Nothing
|
|
|
|
|