Contact Info

Crumbtrail

ActiveXperts.com » Administration » Scripts » WMI » VBScript

Win32_NetworkLoginProfile - WMI sample in VBScript

The foundations for Manageability in Windows 2019/2016/2012/2008 and Windows 10/7/XP are Windows Management Instrumentation (WMI; formerly WBEM) and WMI extensions for Windows Driver Model (WDM).

ActiveXperts Network Monitor provides the ability to build monitor check routines based on WMI. ActiveXperts has collected more than a hundred WMI samples. You can use these samples as a base for new check routines you can write yourself.

On this site, you can find many WMI samples.

The Win32_NetworkLoginProfile WMI class can be used in ActiveXperts Network Monitor to monitor your servers.


Win32_NetworkLoginProfile

Description

The Win32_NetworkLoginProfile WMI class represents the network login information of a specific user on a Windows system. This includes, but is not limited to password status, access privileges, disk quotas, and login directory paths.

Example(s)

  On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_NetworkLoginProfile",,48)
For Each objItem in colItems
    Wscript.Echo "AccountExpires: " & objItem.AccountExpires
    Wscript.Echo "AuthorizationFlags: " & objItem.AuthorizationFlags
    Wscript.Echo "BadPasswordCount: " & objItem.BadPasswordCount
    Wscript.Echo "Caption: " & objItem.Caption
    Wscript.Echo "CodePage: " & objItem.CodePage
    Wscript.Echo "Comment: " & objItem.Comment
    Wscript.Echo "CountryCode: " & objItem.CountryCode
    Wscript.Echo "Description: " & objItem.Description
    Wscript.Echo "Flags: " & objItem.Flags
    Wscript.Echo "FullName: " & objItem.FullName
    Wscript.Echo "HomeDirectory: " & objItem.HomeDirectory
    Wscript.Echo "HomeDirectoryDrive: " & objItem.HomeDirectoryDrive
    Wscript.Echo "LastLogoff: " & objItem.LastLogoff
    Wscript.Echo "LastLogon: " & objItem.LastLogon
    Wscript.Echo "LogonHours: " & objItem.LogonHours
    Wscript.Echo "LogonServer: " & objItem.LogonServer
    Wscript.Echo "MaximumStorage: " & objItem.MaximumStorage
    Wscript.Echo "Name: " & objItem.Name
    Wscript.Echo "NumberOfLogons: " & objItem.NumberOfLogons
    Wscript.Echo "Parameters: " & objItem.Parameters
    Wscript.Echo "PasswordAge: " & objItem.PasswordAge
    Wscript.Echo "PasswordExpires: " & objItem.PasswordExpires
    Wscript.Echo "PrimaryGroupId: " & objItem.PrimaryGroupId
    Wscript.Echo "Privileges: " & objItem.Privileges
    Wscript.Echo "Profile: " & objItem.Profile
    Wscript.Echo "ScriptPath: " & objItem.ScriptPath
    Wscript.Echo "SettingID: " & objItem.SettingID
    Wscript.Echo "UnitsPerWeek: " & objItem.UnitsPerWeek
    Wscript.Echo "UserComment: " & objItem.UserComment
    Wscript.Echo "UserId: " & objItem.UserId
    Wscript.Echo "UserType: " & objItem.UserType
    Wscript.Echo "Workstations: " & objItem.Workstations
Next