Provides methods and properties used to create a session, represented by a Session object. Any Windows Remote Management operations require creation of a Session that connects to a remote computer, base management controller (BMC), or the local computer. Operations include getting, writing, enumerating data, or invoking methods.
The WSMan object defines the following methods.
CreateSession
Creates a Session object that can then be used for subsequent network operations.
CreateConnectionOptions
Creates a ConnectionOptions object that specifies the user name and password used when creating a remote session.
CreateResourceLocator
Creates a ResourceLocator object that can specify:
WSMan.EnumerationFlagNonXmlText
Returns the value of the enumeration constant WSManFlagNonXmlText for use in the flags parameter of the Session.Enumerate method.
WSMan.EnumerationFlagHierarchyDeepBasePropsOnly
Returns the value of the enumeration flag EnumerationFlagHierarchyDeepBasePropsOnly for use in the flags parameter of Session.Enumerate.
WSMan.EnumerationFlagReturnEPR
Returns the value of the enumeration flag EnumerationFlagReturnEPR for use in the flags parameter of Session.Enumerate.
WSMan.EnumerationFlagReturnObjectAndEPR
Returns the value of the enumeration flag EnumerationFlagReturnObjectAndEPR for use in the flags parameter of Session.Enumerate.
WSMan.EnumerationFlagHierarchyDeep
Returns the value of the enumeration flag EnumerationFlagHierarchyDeep for use in the flags parameter of Session.Enumerate.
WSMan.EnumerationFlagHierarchyShallow
Returns the value of the enumeration flag EnumerationFlagHierarchyShallow for use in the flags parameter of Session.Enumerate.
WSMan.EnumerationFlagReturnObject
Returns the value of the enumeration flag EnumerationFlagReturnObject for use in the flags parameter of Session.Enumerate.
WSMan.SessionFlagCredUsernamePassword
Returns the value of the authentication flag WSManFlagCredUsernamePassword for use in the flags parameter of WSMan.CreateSession.
WSMan.SessionFlagEnableSPNServerPort
Returns the value of the authentication flag WSManFlagEnableSPNServerPort for use in the flags parameter of WSMan.CreateSession.
WSMan.GetErrorMessage
Returns a formatted string containing the text of an error number.
WSMan.SessionFlagNoEncryption
Returns the value of the authentication flag WSManFlagNoEncryption for use in the flags parameter of WSMan.CreateSession.
WSMan.SessionFlagSkipCACheck
Returns the value of the WSManFlagSkipCACheck authentication flag for use in the flags parameter of WSMan.CreateSession.
WSMan.SessionFlagSkipCNCheck
Returns the value of the authentication flag WSManFlagSkipCNCheck for use in the flags parameter of WSMan.CreateSession.
WSMan.SessionFlagUseBasic
Returns the value of the authentication flag WSManFlagUseBasic for use in the flags parameter of WSMan.CreateSession.
WSMan.SessionFlagUseDigest
Returns the value of the authentication flag WSManFlagUseDigest for use in the flags parameter of WSMan.CreateSession.
WSMan.SessionFlagUseKerberos
Returns the value of the authentication flag WSManFlagUseKerberos for use in the flags parameter of WSMan.CreateSession.
WSMan.SessionFlagUseNegotiate
Returns the value of the authentication flag WSManFlagUseNegotiate for use in the flags parameter of WSMan.CreateSession.
WSMan.SessionFlagUseNoAuthentication
Returns the value of the authentication flag WSManFlagUseNoAuthentication for use in the flags parameter of WSMan.CreateSession.
WSMan.SessionFlagUTF8
Returns the value of the authentication flag WSManFlagUTF8 for use in the flags parameter of WSMan.CreateSession.
The WSMan object defines the following properties.
CommandLine
Gets the unprocessed command line for the current hosting process.
Error
Gets error information.
The WSMan object corresponds to the IWSMan and IWSManEx interfaces. WSMan is the only object that can be created directly using CreateObject.
The following code example shows how to instantiate a WSMan object.
Dim objWsman Dim Session, Resource Set objWsman = CreateObject( "WSMAN.Automation" ) Set Session = objWsman.CreateSession strResource = "http://schemas.microsoft.com/wbem/wsman/1/" _ & "wmi/root/cimv2/Win32_OperatingSystem"
Send comments about this topic to Microsoft
Build date: 11/2/2009
Are there any examples of using the IWSMan interface in C#? All I can find are VB scripts and I can't find a class that implements the IWSMan interface.
[Noelle Mallory - MSFT] Please post questions to the MSDN Forums at http://forums.microsoft.com/msdn. You will likely get a quicker response through the forum than through the Community Content.