GetCurrentUser Method in Class SMS_Identification

The GetCurrentUser WMI class method returns the domain\username being used by the SMS Provider for authentication. This may differ from the domain\username supplied by the application depending on the domain trust model used.

The following syntax is simplified from MOF code and is intended to show you the definition of the method.

sint32 GetCurrentUser(
  [out] string UserName


  • UserName
    Data type: string
    Qualifiers: Out

    Domain\username being used by the SMS Provider.

Return Values

The GetCurrentUser method returns a sint32 that is always zero (0).

Example Code

The following example shows you how to call this method to get the current user.

Dim Identification As SWbemObject
Dim UserName As String

Set Identification = GetObject("winmgmts:\root\sms\site_<sitecode>:SMS_Identification")
Identification.GetCurrentUser UserName

MsgBox "UserName = " & UserName

See Also