Advertisement
Guest User

Untitled

a guest
Jul 21st, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. $SmbDriveMaps = Get-CimInstance -Namespace root/Microsoft/Windows/SMB -ClassName MSFT_SmbMapping | Select-Object -Property @{Name='DriveLetter';Expression={$_.LocalPath}},@{Name='Path';Expression={$_.RemotePath}},RequireIntegrity,RequirePrivacy
  2.  
  3. $SmbShares = Get-CimInstance -Namespace root/Microsoft/Windows/SMB -ClassName MSFT_SmbShare | Select-Object -Property Name,Path,Description
  4.  
  5. $DnsCache = Get-CimInstance -Namespace root/StandardCimv2 -ClassName MSFT_DNSClientCache | Select-Object -Property Data,Entry,Name,TimeToLive
  6.  
  7. $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
  8.  
  9. $ShareDriveAccess = $SmbDriveMaps | Get-ChildItem -Directory | ForEach-Object {
  10. $Acl = $_ | Get-Acl
  11. $_ | Add-Member -MemberType NoteProperty -Name Owner -Value $Acl.Owner -PassThru |
  12. Add-Member -MemberType NoteProperty -Name Access -Value $Acl.Access -PassThru
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement