WindowsManagementExperts.Win32_NetworkLoginProfile.Class.Discovery (Discovery)

Element properties:

TargetMicrosoft.Windows.Computer
EnabledTrue
Frequency3600
RemotableFalse

Object Discovery Details:

Discovered Classes and their attribuets:
  • WindowsManagementExperts.Win32_NetworkLoginProfile.Class
    • AccountExpires
    • AuthorizationFlags
    • BadPasswordCount
    • Caption
    • CodePage
    • Comment
    • CountryCode
    • Description
    • Flags
    • FullName
    • HomeDirectory
    • HomeDirectoryDrive
    • LastLogoff
    • LastLogon
    • LogonHours
    • LogonServer
    • MaximumStorage
    • Name
    • NumberOfLogons
    • Parameters
    • PasswordAge
    • PasswordExpires
    • PrimaryGroupId
    • Privileges
    • Profile
    • ScriptPath
    • SettingID
    • UnitsPerWeek
    • UserComment
    • UserId
    • UserType
    • Workstations

Member Modules:

ID Module Type TypeId RunAs 
DS DataSource Microsoft.Windows.TimedPowerShell.DiscoveryProvider Default

Source Code:

<Discovery ID="WindowsManagementExperts.Win32_NetworkLoginProfile.Class.Discovery" Target="Windows!Microsoft.Windows.Computer" Remotable="true" Enabled="true">
<Category>Discovery</Category>
<DiscoveryTypes>
<DiscoveryClass TypeID="WindowsManagementExperts.Win32_NetworkLoginProfile.Class">
<Property PropertyID="AccountExpires"/>
<Property PropertyID="AuthorizationFlags"/>
<Property PropertyID="BadPasswordCount"/>
<Property PropertyID="Caption"/>
<Property PropertyID="CodePage"/>
<Property PropertyID="Comment"/>
<Property PropertyID="CountryCode"/>
<Property PropertyID="Description"/>
<Property PropertyID="Flags"/>
<Property PropertyID="FullName"/>
<Property PropertyID="HomeDirectory"/>
<Property PropertyID="HomeDirectoryDrive"/>
<Property PropertyID="LastLogoff"/>
<Property PropertyID="LastLogon"/>
<Property PropertyID="LogonHours"/>
<Property PropertyID="LogonServer"/>
<Property PropertyID="MaximumStorage"/>
<Property PropertyID="Name"/>
<Property PropertyID="NumberOfLogons"/>
<Property PropertyID="Parameters"/>
<Property PropertyID="PasswordAge"/>
<Property PropertyID="PasswordExpires"/>
<Property PropertyID="PrimaryGroupId"/>
<Property PropertyID="Privileges"/>
<Property PropertyID="Profile"/>
<Property PropertyID="ScriptPath"/>
<Property PropertyID="SettingID"/>
<Property PropertyID="UnitsPerWeek"/>
<Property PropertyID="UserComment"/>
<Property PropertyID="UserId"/>
<Property PropertyID="UserType"/>
<Property PropertyID="Workstations"/>
</DiscoveryClass>
</DiscoveryTypes>
<DataSource ID="DS" TypeID="Windows!Microsoft.Windows.TimedPowerShell.DiscoveryProvider">
<IntervalSeconds>3600</IntervalSeconds>
<SyncTime/>
<ScriptName>Win32_NetworkLoginProfile.ps1</ScriptName>
<ScriptBody><Script>

param($sourceId,$managedEntityId,$computerName)


$oAPI = new-object -comobject "MOM.ScriptAPI"
$oDiscoveryData = $oAPI.CreateDiscoveryData(0, $sourceId, $managedEntityId)
$l = new-object -comobject "WbemScripting.SWbemLocator"
$svc = $l.ConnectServer($computerName, "root\CIMV2")
$svc.Security_.AuthenticationLevel=6
$svc.Security_.ImpersonationLevel=3
$objs = $svc.InstancesOf("Win32_NetworkLoginProfile")

$range = $objs

$count = $range.Count

For($i=0; $i -lt $count; $i++)
{

$obj = $objs.ItemIndex($i)
$oInst = $oDiscoveryData.CreateClassInstance("$MPElement[Name='WindowsManagementExperts.Win32_NetworkLoginProfile.Class']$")
$oInst.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", $computerName)
$oInst.AddProperty("$MPElement[Name='WindowsManagementExperts.Win32_NetworkLoginProfile.Class']/AccountExpires$", $obj.Properties_.Item("AccountExpires").Value)
$oInst.AddProperty("$MPElement[Name='WindowsManagementExperts.Win32_NetworkLoginProfile.Class']/AuthorizationFlags$", $obj.Properties_.Item("AuthorizationFlags").Value)
$oInst.AddProperty("$MPElement[Name='WindowsManagementExperts.Win32_NetworkLoginProfile.Class']/BadPasswordCount$", $obj.Properties_.Item("BadPasswordCount").Value)
$oInst.AddProperty("$MPElement[Name='WindowsManagementExperts.Win32_NetworkLoginProfile.Class']/Caption$", $obj.Properties_.Item("Caption").Value)
$oInst.AddProperty("$MPElement[Name='WindowsManagementExperts.Win32_NetworkLoginProfile.Class']/CodePage$", $obj.Properties_.Item("CodePage").Value)
$oInst.AddProperty("$MPElement[Name='WindowsManagementExperts.Win32_NetworkLoginProfile.Class']/Comment$", $obj.Properties_.Item("Comment").Value)
$oInst.AddProperty("$MPElement[Name='WindowsManagementExperts.Win32_NetworkLoginProfile.Class']/CountryCode$", $obj.Properties_.Item("CountryCode").Value)
$oInst.AddProperty("$MPElement[Name='WindowsManagementExperts.Win32_NetworkLoginProfile.Class']/Description$", $obj.Properties_.Item("Description").Value)
$oInst.AddProperty("$MPElement[Name='WindowsManagementExperts.Win32_NetworkLoginProfile.Class']/Flags$", $obj.Properties_.Item("Flags").Value)
$oInst.AddProperty("$MPElement[Name='WindowsManagementExperts.Win32_NetworkLoginProfile.Class']/FullName$", $obj.Properties_.Item("FullName").Value)
$oInst.AddProperty("$MPElement[Name='WindowsManagementExperts.Win32_NetworkLoginProfile.Class']/HomeDirectory$", $obj.Properties_.Item("HomeDirectory").Value)
$oInst.AddProperty("$MPElement[Name='WindowsManagementExperts.Win32_NetworkLoginProfile.Class']/HomeDirectoryDrive$", $obj.Properties_.Item("HomeDirectoryDrive").Value)
$oInst.AddProperty("$MPElement[Name='WindowsManagementExperts.Win32_NetworkLoginProfile.Class']/LastLogoff$", $obj.Properties_.Item("LastLogoff").Value)
$oInst.AddProperty("$MPElement[Name='WindowsManagementExperts.Win32_NetworkLoginProfile.Class']/LastLogon$", $obj.Properties_.Item("LastLogon").Value)
$oInst.AddProperty("$MPElement[Name='WindowsManagementExperts.Win32_NetworkLoginProfile.Class']/LogonHours$", $obj.Properties_.Item("LogonHours").Value)
$oInst.AddProperty("$MPElement[Name='WindowsManagementExperts.Win32_NetworkLoginProfile.Class']/LogonServer$", $obj.Properties_.Item("LogonServer").Value)
$oInst.AddProperty("$MPElement[Name='WindowsManagementExperts.Win32_NetworkLoginProfile.Class']/MaximumStorage$", $obj.Properties_.Item("MaximumStorage").Value)
$oInst.AddProperty("$MPElement[Name='WindowsManagementExperts.Win32_NetworkLoginProfile.Class']/Name$", $obj.Properties_.Item("Name").Value)
$oInst.AddProperty("$MPElement[Name='WindowsManagementExperts.Win32_NetworkLoginProfile.Class']/NumberOfLogons$", $obj.Properties_.Item("NumberOfLogons").Value)
$oInst.AddProperty("$MPElement[Name='WindowsManagementExperts.Win32_NetworkLoginProfile.Class']/Parameters$", $obj.Properties_.Item("Parameters").Value)
$oInst.AddProperty("$MPElement[Name='WindowsManagementExperts.Win32_NetworkLoginProfile.Class']/PasswordAge$", $obj.Properties_.Item("PasswordAge").Value)
$oInst.AddProperty("$MPElement[Name='WindowsManagementExperts.Win32_NetworkLoginProfile.Class']/PasswordExpires$", $obj.Properties_.Item("PasswordExpires").Value)
$oInst.AddProperty("$MPElement[Name='WindowsManagementExperts.Win32_NetworkLoginProfile.Class']/PrimaryGroupId$", $obj.Properties_.Item("PrimaryGroupId").Value)
$oInst.AddProperty("$MPElement[Name='WindowsManagementExperts.Win32_NetworkLoginProfile.Class']/Privileges$", $obj.Properties_.Item("Privileges").Value)
$oInst.AddProperty("$MPElement[Name='WindowsManagementExperts.Win32_NetworkLoginProfile.Class']/Profile$", $obj.Properties_.Item("Profile").Value)
$oInst.AddProperty("$MPElement[Name='WindowsManagementExperts.Win32_NetworkLoginProfile.Class']/ScriptPath$", $obj.Properties_.Item("ScriptPath").Value)
$oInst.AddProperty("$MPElement[Name='WindowsManagementExperts.Win32_NetworkLoginProfile.Class']/SettingID$", $obj.Properties_.Item("SettingID").Value)
$oInst.AddProperty("$MPElement[Name='WindowsManagementExperts.Win32_NetworkLoginProfile.Class']/UnitsPerWeek$", $obj.Properties_.Item("UnitsPerWeek").Value)
$oInst.AddProperty("$MPElement[Name='WindowsManagementExperts.Win32_NetworkLoginProfile.Class']/UserComment$", $obj.Properties_.Item("UserComment").Value)
$oInst.AddProperty("$MPElement[Name='WindowsManagementExperts.Win32_NetworkLoginProfile.Class']/UserId$", $obj.Properties_.Item("UserId").Value)
$oInst.AddProperty("$MPElement[Name='WindowsManagementExperts.Win32_NetworkLoginProfile.Class']/UserType$", $obj.Properties_.Item("UserType").Value)
$oInst.AddProperty("$MPElement[Name='WindowsManagementExperts.Win32_NetworkLoginProfile.Class']/Workstations$", $obj.Properties_.Item("Workstations").Value)
$oDiscoveryData.AddInstance($oInst)
}
$oDiscoveryData

</Script></ScriptBody>
<Parameters>
<Parameter>
<Name>sourceID</Name>
<Value>$MPElement$</Value>
</Parameter>
<Parameter>
<Name>managedEntityID</Name>
<Value>$Target/Id$</Value>
</Parameter>
<Parameter>
<Name>computerName</Name>
<Value>$Target/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Value>
</Parameter>
</Parameters>
<TimeoutSeconds>120</TimeoutSeconds>
</DataSource>
</Discovery>