Real Geek Forums  

Go Back   Real Geek Forums > Archives > Operating Systems > Windows XP > Windows XP WMI

Notices

Reply

opsys.win32shutdown doesn't work on Domain controllers

 

LinkBack Thread Tools Display Modes
Old 04-29-2005, 01:14 AM   #1 (permalink)
Default opsys.win32shutdown doesn't work on Domain controllers

hello,
I have a script that runs when a user logs in that checks to see whether
they are logged in already somewhere else by keeping track of the
workstation name in a custom attribute I created in AD. Based on the
logic I use if the user is being detected as having logged in somewhere
already they are immediately logged off using WMI's opsys.win32shutdown
class. I just simply use the EWX_LOGOFF flag and it works great.
Unfortunately with strict government requirements that I have to follow
I also have to restrict administrators to this same situation which in
and of itself isn't difficult to do until this script attempts to log
them off of a domain controller if a DC happens to be their 2nd logon
attempt. I get an error on the opsys.win32shutdown line when the script
runs on a domain controller and it won't log the user off then. I tried
using the FORCE flag but that didn't help. From what I've read it is
possible to reboot *any* machine this way but is it not possible to log
someone off a domain controller this way? The error code I get back is
80041001 which is one of the generic errors that is of no help
whatsoever.

thanks

Brandon McCombs
Guest
 
Posts: n/a
Reply With Quote  
Old 04-29-2005, 10:14 AM   #2 (permalink)
Default Re: opsys.win32shutdown doesn't work on Domain controllers

Brandon McCombs wrote:
Quote:
> hello,
> I have a script that runs when a user logs in that checks to see whether
> they are logged in already somewhere else by keeping track of the
> workstation name in a custom attribute I created in AD. Based on the
> logic I use if the user is being detected as having logged in somewhere
> already they are immediately logged off using WMI's opsys.win32shutdown
> class. I just simply use the EWX_LOGOFF flag and it works great.
> Unfortunately with strict government requirements that I have to follow
> I also have to restrict administrators to this same situation which in
> and of itself isn't difficult to do until this script attempts to log
> them off of a domain controller if a DC happens to be their 2nd logon
> attempt. I get an error on the opsys.win32shutdown line when the script
> runs on a domain controller and it won't log the user off then. I tried
> using the FORCE flag but that didn't help. From what I've read it is
> possible to reboot *any* machine this way but is it not possible to log
> someone off a domain controller this way? The error code I get back is
> 80041001 which is one of the generic errors that is of no help
> whatsoever.
Hi,

See if adding some additional privileges helps:

sComputer = "."
Set oWMI = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate,(Shutdown,RemoteS hutdown,Debug)}!\\" _
& sComputer & "\root\cimv2")



--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scr...r/default.mspx
Torgeir Bakken \(MVP\)
Guest
 
Posts: n/a
Reply With Quote  
Old 04-30-2005, 01:27 AM   #3 (permalink)
Default Re: opsys.win32shutdown doesn't work on Domain controllers



"Torgeir Bakken (MVP)" wrote:
Quote:
> Brandon McCombs wrote:
>
Quote:
> > hello,
> > I have a script that runs when a user logs in that checks to see whether
> > they are logged in already somewhere else by keeping track of the
> > workstation name in a custom attribute I created in AD. Based on the
> > logic I use if the user is being detected as having logged in somewhere
> > already they are immediately logged off using WMI's opsys.win32shutdown
> > class. I just simply use the EWX_LOGOFF flag and it works great.
> > Unfortunately with strict government requirements that I have to follow
> > I also have to restrict administrators to this same situation which in
> > and of itself isn't difficult to do until this script attempts to log
> > them off of a domain controller if a DC happens to be their 2nd logon
> > attempt. I get an error on the opsys.win32shutdown line when the script
> > runs on a domain controller and it won't log the user off then. I tried
> > using the FORCE flag but that didn't help. From what I've read it is
> > possible to reboot *any* machine this way but is it not possible to log
> > someone off a domain controller this way? The error code I get back is
> > 80041001 which is one of the generic errors that is of no help
> > whatsoever.
> Hi,
>
> See if adding some additional privileges helps:
>
> sComputer = "."
> Set oWMI = GetObject("winmgmts:" _
> & "{impersonationLevel=impersonate,(Shutdown,RemoteS hutdown,Debug)}!\\" _
> & sComputer & "\root\cimv2")
>
>
I didn't think that would work and it did not. Considering the privilege should
be the same for the workstaitons as the server I don't see why I would need to do
any impersonation to log a user off of a domain controller. I should have been
getting different errors as well if it was a permission issue, instead I was
getting a general error that was of no help. Any other ideas?

Is it even possible to run win32shutdown with EWX_LOGOFF to log someone off of a
domain controller?

Brandon McCombs
Guest
 
Posts: n/a
Reply With Quote  
Old 05-01-2005, 06:22 AM   #4 (permalink)
Default Re: opsys.win32shutdown doesn't work on Domain controllers



"Torgeir Bakken (MVP)" wrote:
Quote:
> Brandon McCombs wrote:
>
Quote:
> > hello,
> > I have a script that runs when a user logs in that checks to see whether
> > they are logged in already somewhere else by keeping track of the
> > workstation name in a custom attribute I created in AD. Based on the
> > logic I use if the user is being detected as having logged in somewhere
> > already they are immediately logged off using WMI's opsys.win32shutdown
> > class. I just simply use the EWX_LOGOFF flag and it works great.
> > Unfortunately with strict government requirements that I have to follow
> > I also have to restrict administrators to this same situation which in
> > and of itself isn't difficult to do until this script attempts to log
> > them off of a domain controller if a DC happens to be their 2nd logon
> > attempt. I get an error on the opsys.win32shutdown line when the script
> > runs on a domain controller and it won't log the user off then. I tried
> > using the FORCE flag but that didn't help. From what I've read it is
> > possible to reboot *any* machine this way but is it not possible to log
> > someone off a domain controller this way? The error code I get back is
> > 80041001 which is one of the generic errors that is of no help
> > whatsoever.
> Hi,
>
> See if adding some additional privileges helps:
>
> sComputer = "."
> Set oWMI = GetObject("winmgmts:" _
> & "{impersonationLevel=impersonate,(Shutdown,RemoteS hutdown,Debug)}!\\" _
> & sComputer & "\root\cimv2")
>
>
I sent a friend of mine the script I use and also a script that I found online
and it seems that rebooting and shutting down a domain controller works just fine
but the damn logoff does not work on a DC which is of course the functionality I
need. WHy wouldn't a logoff with the same script work on a workstation but not on
a DC and is there a workaround to log someone off of a domain controller
automatically that can not be cancelled?

thanks

Brandon McCombs
Guest
 
Posts: n/a
Reply With Quote  
Reply

Tags
None

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

Thread Thread Starter Forum Replies Last Post
Games-USB( xBox - PS2) controllers Jeff Windows Vista Games 1 01-29-2007 05:17 PM
HP LaserJet 1010 don't work in Vista since Beta2 - Advanced 1384 Printing Support drivers for XP don't work Alexey Windows Vista Printers & Scanners 2 10-19-2006 12:05 AM
sis storport ahci controllers tomhyde2 Windows Vista Hardware & Devices 0 06-09-2006 07:45 PM
MS Sidewiner Game Controllers Adahn Windows Vista Hardware & Devices 4 03-09-2006 06:38 PM
Support for AHCI/RAID SATA 2 HDD controllers? Andre Da Costa [Extended64] Windows Vista Hardware & Devices 1 03-04-2006 03:47 PM


All times are GMT. The time now is 08:48 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright © 2005 - 2007 RealGeek.com. All rights reserved.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90