Powershell : QuickCMD : Use PowerShell to Display User Rights to File Volume

Display access to an NTFS volume

Get-Acl | select -ExpandProperty access

http://blogs.technet.com/b/heyscriptingguy/archive/2013/06/11/powertip-use-powershell-to-display-user-rights-to-file-volume.aspx

Advertisements

Powershell : QuickCMD : Import data from a .TXT file

Reading a Text File

Get-Content c:\scripts\test.txt

Import Text file content to a var

$var = Get-Content c:\scripts\test.txt

Using pipeline to pass the data to another cmdlet

Get-Content c:\scripts\test.txt | Foreach-Object {Get-Wmiobject -computername $_ win32_bios}

Count the number of lines of the array created from the Text file

Get-Content c:\scripts\test.txt | Measure-Object

Import only the first/last 5 lines from the Text file

Get-Content c:\scripts\test.txt -totalcount 5
Get-Content c:\scripts\test.txt | Select-Object -last 5

Get-Content Aliases

  • gc
  • type
  • cat

http://technet.microsoft.com/en-us/library/ee176843.aspx

Powershell : QuickCMD : Find/Modify the default Active Directory Domain Services (AD DS) domain password policy

Get the default password policy for an Active Directory domain

 Get-ADDefaultDomainPasswordPolicy  [-Identity] <ADDefaultDomainPasswordPolicy>

Get-ADDefaultDomainPasswordPolicy

Modify the default password policy for the current Active Directory domain disableing the password history count

 Get-ADDomain | Set-ADDefaultDomainPasswordPolicy -PasswordHistoryCount 0