$objUser=New-ObjectSystem.Security.Principal.NTAccount($env:UserName)$strSID=$objUser.Translate([System.Security.Principal.SecurityIdentifier]).Value$strSID 运行这个命令后,将显示当前用户的 SID。 PowerShell 命令来获取当前计算机上所有会话的信息: powershellCopy Code Get-WmiObject Win32_LogonSession |Sele...
在Linux系统中,用户帐户和登录详细信息对于系统管理和安全非常重要。了解如何查找和管理用户帐户信息以及...
DistinguishedName : CN=DC01,OU=Domain Controllers,DC=mikefrobbins,DC=com DNSHostName : dc01.mikefrobbins.com Enabled : True Name : DC01 ObjectClass : computer ObjectGUID : c38da20c-a484-469d-ba4c-bab3fb71ae8e SamAccountName : DC01$ SID : S-1-5-21-2989741381-570885089-3319121794-1001 ...
{get;set;} ObjectGUID Property System.Nullable`1[[System.Guid, mscorlib, Ve... SamAccountName Property System.String SamAccountName {get;set;} SID Property System.Security.Principal.SecurityIdentifier... Surname Property System.String Surname {get;set;} UserPrincipalName Property System.String User...
Job {1A776B6A-5BAC-11E3-BF41-00155D553612} : Configuration is sent from computer NULL by user sid S-1-5-18. Job {1A776B6A-5BAC-11E3-BF41-00155D553612} : Displaying messages from built-in DSC resources: WMI channel 1 ResourceID: Message : [INCH-VM]: [] Starting consistency ...
Get-WmiObject-Query "SELECT * FROM Win32_LogicalDisk WHERE DriveType=3" 这将返回所有逻辑磁盘的信息,其中DriveType=3表示逻辑磁盘是本地磁盘。 Get-WmiObject命令非常强大,可以用于许多管理和监控任务。通过组合它与其他 PowerShell 命令和功能,可以创建强大的自动化脚本和管理工具。
Get-WinEvent[-MaxEvents <Int64>] [-ComputerName <String>] [-Credential <PSCredential>] [-FilterHashtable] <Hashtable[]> [-Force] [-Oldest] [<CommonParameters>] PowerShell Get-WinEvent[-MaxEvents <Int64>] [-ComputerName <String>] [-Credential <PSCredential>] [-FilterXml] <XmlDocument> ...
UserID金鑰可以採用有效的安全性識別碼 (SID) 或可用來建構有效System.Security.Principal.NTAccount 物件的功能變數名稱。 [數據]值會採用未命名字段中的事件數據。 例如,傳統事件記錄檔中的事件。 <named-data>索引鍵代表具名事件數據欄位。 當無法解譯索引鍵/值組時Get-WinEvent,它會將索...
1.用PowerShell查询指定OU中所有账号的创建时间\SID\上次修改密码时间\最后一次登录时间: Get-ADuser -searchbase ' OU=LL,DC=LL,DC=COM ' -filter * -Properties * | Select-Object Name,SID, Created,PasswordLastSet,@{n="lastLogonDate";e={[datetime]::FromFileTime ...
# Get all computers in the current domain Get-NetComputer # Get all domains in current forest Get-NetForestDomain # Get domain/forest trusts Get-NetDomainTrust Get-NetForestTrust # Get information for the DA group Get-NetGroup -GroupName "Domain Admins" ...