This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$BitLockerVolumes = Get-BitLockerVolume | |
foreach ($blv in $BitLockerVolumes) { | |
BackupToAAD-BitLockerKeyProtector -MountPoint $blv.MountPoint -KeyProtectorId (($blv.KeyProtector)[1] | Select-Object -ExpandProperty KeyProtectorID) | |
} | |
ComputerName: NBMCZERNIAWSKI2 | |
VolumeType Mount CapacityGB VolumeStatus Encryption KeyProtector AutoUnlock Protection | |
Point Percentage Enabled Status |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$BitLockerVolumes = Get-BitLockerVolume | |
foreach ($blv in $BitLockerVolumes) { | |
Backup-BitLockerKeyProtector -MountPoint $blv.MountPoint -KeyProtectorId (($blv.KeyProtector)[1] | Select-Object -ExpandProperty KeyProtectorID) | |
} | |
ComputerName: NBMCZERNIAWSKI2 | |
VolumeType Mount CapacityGB VolumeStatus Encryption KeyProtector AutoUnlock Protection | |
Point Percentage Enabled Status |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Computers = Get-ADComputer -filter * -SearchBase 'OU=Servers,OU=ComputersX,DC=contoso,DC=com' | Select-Object -ExpandProperty Name | |
$Allcerts = Invoke-Command -ComputerName $Computers -ScriptBlock { | |
Get-childItem Cert:\LocalMachine\My | Select-Object DnsNameList,NotBefore,NotAfter,Thumbprint,Issuer,Subject | |
} -ErrorAction SilentlyContinue | |
#region get all certs that expired | |
#get current date | |
$date = Get-Date |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Computers = Get-ADComputer -filter * -SearchBase 'OU=Servers,OU=ComputersX,DC=contoso,DC=com' | Select-Object -ExpandProperty Name | |
$Allcerts = Invoke-Command -ComputerName $Computers -ScriptBlock { | |
Get-childItem Cert:\LocalMachine\My | Select-Object DnsNameList,NotBefore,NotAfter,Thumbprint,Issuer,Subject | |
} -ErrorAction SilentlyContinue | |
#region get the cert we're looking for | |
$thumbprint = 'PLACEYOURTHUMBPRINTHERE' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$AdComputerFilter = 'DNSHostName','lastLogon','lastlogontimestamp','operatingSystem','operatingSystemVersion','whenChanged','whenCreated' | |
$SelectObjectFilter = @( | |
'DNSHostName', | |
@{name='lastLogon';e={[datetime]::FromFileTime($PSItem.'lastLogon') }}, | |
@{name='lastLogontimestamp';e={[datetime]::FromFileTime($PSItem.'lastLogontimestamp') }}, | |
'operatingSystem','operatingSystemVersion','whenCreated','whenChanged','DistinguishedName', | |
@{name='InUse';e={''}}, | |
@{name='CurrentAccessList';e={''}}, | |
@{name='Applications';e={''}}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$AdComputerFilter = 'DNSHostName','lastLogon','lastlogontimestamp','operatingSystem','operatingSystemVersion','whenChanged','whenCreated' | |
$SelectObjectFilter = @( | |
'DNSHostName', | |
@{name='lastLogon';e={[datetime]::FromFileTime($PSItem.'lastLogon') }}, | |
@{name='lastLogontimestamp';e={[datetime]::FromFileTime($PSItem.'lastLogontimestamp') }}, | |
'operatingSystem','operatingSystemVersion','whenCreated','whenChanged','DistinguishedName', | |
@{name='InUse';e={''}}, | |
@{name='CurrentAccessList';e={''}}, | |
@{name='Applications';e={''}}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-ADComputer -Filter * -SearchBase 'OU=Servers,OU=Computers,DC=contoso,DC=com' -properties 'operatingSystem','whenCreated','whenChanged' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-ADComputer -Filter * -SearchBase 'OU=Servers,OU=Computers,DC=contoso,DC=com' -Properties 'DNSHostName','lastLogon','lastlogontimestamp','operatingSystem','operatingSystemVersion','whenChanged','whenCreated' | Select-Object 'DNSHostName', | |
@{name='lastLogon';e={[datetime]::FromFileTime($PSItem.'lastLogon') }}, | |
@{name='lastLogontimestamp';e={[datetime]::FromFileTime($PSItem.'lastLogontimestamp') }}, | |
'operatingSystem','operatingSystemVersion','whenCreated','whenChanged','DistinguishedName', | |
@{name='InUse';e={''}}, | |
@{name='CurrentAccessList';e={''}}, | |
@{name='Applications';e={''}}, | |
@{name='SystemUpdate';e={''}}, | |
@{name='PM';e={''}}, | |
@{name='TO';e={''}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$VMName = 'SomeVM' | |
$GUID = Get-VM $VMName | Select-Object -ExpandProperty id | Select-Object -ExpandProperty Guid | |
$processID = Get-Process vmwp -IncludeUserName | Where-Object {$_.Username -match $GUID} | Select-Object -ExpandProperty ID |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$VMName = 'SomeVM' | |
#Get VM disk path. Assuming there's only one VHD here | |
$VHDPath = Get-VMHardDiskDrive $VMName | Select-Object -ExpandProperty Path | |
#Verify VHD information, including current size | |
Get-VHD -Path $VHDPath | |
#Expand the disk | |
$newSize = 120GB | |
Resize-VHD -Path $VHDPath -SizeBytes $newSize |