Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $SmbDriveMaps = Get-CimInstance -Namespace root/Microsoft/Windows/SMB -ClassName MSFT_SmbMapping | Select-Object -Property @{Name='DriveLetter';Expression={$_.LocalPath}},@{Name='Path';Expression={$_.RemotePath}},RequireIntegrity,RequirePrivacy
- $SmbShares = Get-CimInstance -Namespace root/Microsoft/Windows/SMB -ClassName MSFT_SmbShare | Select-Object -Property Name,Path,Description
- $DnsCache = Get-CimInstance -Namespace root/StandardCimv2 -ClassName MSFT_DNSClientCache | Select-Object -Property Data,Entry,Name,TimeToLive
- $NetNeighbors = Get-CimInstance -Namespace root/StandardCimv2 -ClassName MSFT_NetNeighbor -Property IPAddress,LinkLayerAddress,InterfaceAlias -Filter 'NOT IPAddress LIKE "ff02%" AND NOT IPAddress LIKE "255%" AND NOT IPAddress LIKE "224%" AND NOT IPAddress LIKE "239%" AND NOT LinkLayerAddress LIKE "FF-FF-FF-FF-FF-FF" AND NOT LinkLayerAddress LIKE "00-00-00-00-00-00"' | Select-Object -Property IPAddress,LinkLayerAddress,InterfaceAlias
- $ShareDriveAccess = $SmbDriveMaps | Get-ChildItem -Directory | ForEach-Object {
- $Acl = $_ | Get-Acl
- $_ | Add-Member -MemberType NoteProperty -Name Owner -Value $Acl.Owner -PassThru |
- Add-Member -MemberType NoteProperty -Name Access -Value $Acl.Access -PassThru
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement