Shutdown method of the Win32_OperatingSystem Class
Applies to: desktop apps only
The Shutdown WMI class method unloads programs and DLLs until it is safe to turn off the computer. All file buffers are flushed to the disk, and all of the running processes are stopped. On computer systems running Windows 2000 or Windows NT, the calling process must have the SE_SHUTDOWN_NAME privilege.
This topic uses Managed Object Format (MOF) syntax. For more information about using this method, see Calling a Method.
Syntax
uint32 Shutdown();
Parameters
This method has no parameters.
Examples
For script code examples, see WMI Tasks for Scripts and Applications and the TechNet ScriptCenter Script Repository.
For C++ code examples, see WMI C++ Application Examples.
Requirements
|
Minimum supported client | Windows 2000 Professional |
|---|---|
|
Minimum supported server | Windows 2000 Server |
|
Namespace |
\root\CIMV2 |
|
MOF |
|
|
DLL |
|
See also
Send comments about this topic to Microsoft
Build date: 3/9/2012
- 3/15/2011
- wagnerloiro48
# shutdown-system.ps1
# Shutdown windows using PowerShell
# Thomas Lee - tfl@psp.co.uk
# get the object
$system = Get-WmiObject win32_operatingsystem
# display it
"Results:"
$system
# and shutdown
# nb next line is commented out. Be careful!
# running this a Server 2008 LUA results in an exception
#$system.shutdown(2)
- 7/16/2008
- Thomas Lee