Ghost21 Posted July 9, 2007 Share Posted July 9, 2007 Trying to find out if a USer is an ADMIN , POWER USER , USER , REMOTE DESKTOP USER , ETC.. So far I have had no problem checking with ISADMIN () to see if its an admin , But what kind of user is it ??? Link to comment Share on other sites More sharing options...
Ghost21 Posted July 9, 2007 Author Share Posted July 9, 2007 Trying to find out if a USer is an ADMIN , POWER USER , USER , REMOTE DESKTOP USER , ETC.. So far I have had no problem checking with ISADMIN () to see if its an admin , But what kind of user is it ??? Come on All you Very smart people .. I know there must be a way to find this out... Link to comment Share on other sites More sharing options...
PsaltyDS Posted July 10, 2007 Share Posted July 10, 2007 Come on All you Very smart people .. I know there must be a way to find this out... List group membership for the user. You could list each of those groups, looking for the user, but that's the hard way: #include <array.au3> $Domain = @ComputerName $User = @UserName $oUser = ObjGet("WinNT://" & $Domain & "/" & $User) Dim $avGroups[1] = [0] If IsObj($oUser) Then $colGroups = $oUser.Groups For $oGroup In $colGroups _ArrayAdd($avGroups, $oGroup.name) Next $avGroups[0] = UBound($avGroups) - 1 _ArrayDisplay($avGroups, "Groups for user:") Else MsgBox(16, "Error", "Faile to get object for user: " & $Domain & "/" & $User) EndIf Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Ghost21 Posted July 11, 2007 Author Share Posted July 11, 2007 List group membership for the user. You could list each of those groups, looking for the user, but that's the hard way: #include <array.au3> $Domain = @ComputerName $User = @UserName $oUser = ObjGet("WinNT://" & $Domain & "/" & $User) Dim $avGroups[1] = [0] If IsObj($oUser) Then $colGroups = $oUser.Groups For $oGroup In $colGroups _ArrayAdd($avGroups, $oGroup.name) Next $avGroups[0] = UBound($avGroups) - 1 _ArrayDisplay($avGroups, "Groups for user:") Else MsgBox(16, "Error", "Faile to get object for user: " & $Domain & "/" & $User) EndIf I just keep getting this ERROR MsgBox(16, "Error", "Faile to get object for user: " & $Domain & "/" & $User) Thats it.. Link to comment Share on other sites More sharing options...
PsaltyDS Posted July 11, 2007 Share Posted July 11, 2007 I just keep getting this ERROR MsgBox(16, "Error", "Faile to get object for user: " & $Domain & "/" & $User)I tested it before posting with XP Pro SP2. What is your environment, OS, and are you an admin on the box? Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Ghost21 Posted July 11, 2007 Author Share Posted July 11, 2007 I tested it before posting with XP Pro SP2. What is your environment, OS, and are you an admin on the box? Yes I'm running XP PRO SP2 and I'm an administrator and Domain admin.. Link to comment Share on other sites More sharing options...
MisterBates Posted July 13, 2007 Share Posted July 13, 2007 I just keep getting this ERROR MsgBox(16, "Error", "Faile to get object for user: " & $Domain & "/" & $User)Thats it..Try replacing $Domain = @ComputerName with $Domain = 'localHost' [u]MisterBates[/u]_____________________________________________________Suspend/Resume Windows ScreensaverWatchWindows - Window watcher/loggerUDF: Click systray menu/submenu itemsUDF: Outlook Express Folder/Message handling (+ example code)HowTo: Multiple icons in one compiled script Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now