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
$OUsServers | ForEach-Object { | |
$serverProps = @{ | |
Identity = $_ | |
AllowedPrincipals = $ServerGroupProps.SamAccountName | |
} | |
Set-AdmPwdComputerSelfPermission -OrgUnit $_ | |
Set-AdmPwdReadPasswordPermission @serverProps | |
} |
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
$OUsServers = @('OU=TestBedSecurity,OU=Servers,DC=contoso,DC=com') | |
$OUsWorkstations =@('OU=TestBedSecurity,OU=Workstations,DC=contoso,DC=com') | |
$OUsServers | ForEach-Object { | |
Find-AdmPwdExtendedRights -identity $_ | fl | |
} | |
$OUsWorkstations | ForEach-Object { | |
Find-AdmPwdExtendedRights -identity $_ | fl | |
} |
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
$cluster = 'cluster' | |
$HVNodesActive = Get-ClusterNode -Cluster $cluster | where {$_.State -eq 'UP'} | |
$AllVMs = Get-VM -ComputerName $HVNodesActive | select Name,Path,ComputerName | |
#MOVE VMS where Storage IS | |
foreach ($hvhost in $HVNodesActive) { | |
foreach ($VM in ($AllVMs | where {$_.ComputerName -ne $hvhost -AND $_.Path -match $hvhost} ).Name) { | |
Get-ClusterGroup $VM -Cluster $cluster | Move-ClusterVirtualMachineRole -Node $hvhost -Wait 0 -ErrorAction SilentlyContinue | |
} | |
} |
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
$clusterName = 'YourCLusterName' | |
Get-VM -computername (Get-ClusterNode -Cluster $clusterName).Name | | |
Get-VMDvdDrive | | |
Where-Object {$null -ne $_.Path} | | |
Select-Object VMName,ComputerName,Path | | |
Out-GridView -PassThru | ForEach-Object { | |
Set-VMDvdDrive -Path $null -ComputerName $PSItem.ComputerName -VMName $PSItem.VMName -Passthru | |
} |
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
New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\VMICTimeProvider -Name Enabled -Value 0 –Force |
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
w32tm /config /manualpeerlist:"212.244.36.227 80.50.231.226 pool.ntp.org" /syncfromflags:manual /reliable:yes /update | |
w32tm /config /update | |
Stop-Service w32time | |
sleep(5) | |
Start-Service w32time | |
w32tm /resync /rediscover | |
w32tm /query /source |
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
w32tm /config /syncfromflags:domhier /reliable:no | |
w32tm /config /update | |
Stop-Service w32time | |
sleep(5) | |
Start-Service w32time | |
w32tm /resync /rediscover | |
w32tm /query /source |
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
$StorageJobIDs = Get-StorageJob | Select-Object ObjectID | Select-String -Pattern '([A-Za-z0-9]{8}\-?){1}([A-Za-z0-9]{4}\-?){3}([A-Za-z0-9]{12})' -AllMatches | | |
Select-Object -ExpandProperty Matches | | |
Select-Object -ExpandProperty Value -Last 1 | |
foreach ($objectId in $StorageJobIDs) { | |
Get-VirtualDisk | Where-Object {$_.ObjectId -match $objectID} | |
} |
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
$StorageJobs = Get-StorageJob | |
foreach ($stJob in $StorageJobs) { | |
foreach ($jobObjectID in ($stJob | Select-Object -ExpandProperty ObjectId)) { | |
$objectID = $jobObjectID | Select-String -Pattern '([A-Za-z0-9]{8}\-?){1}([A-Za-z0-9]{4}){1}' -AllMatches | | |
Select-Object -ExpandProperty Matches | | |
Select-Object -ExpandProperty Value -Last 1 | |
$vdisk = Get-VirtualDisk | Where-Object {$_.ObjectId -match $objectID} | |
[PSCustomObject]@{ | |
VirtualDiskName = $vdisk.FriendlyName | |
HealthStatus = $vdisk.HealthStatus |