This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 | |
| #region Workflow declaration | |
| Workflow Invoke-ParallelLiveMigrateStorage | |
| { | |
| Param ( | |
| [parameter(Mandatory=$true)] | |
| $VMList, |
This file contains hidden or 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 hidden or 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
| $disks=Get-PhysicalDisk | where {$_.operationalstatus -eq 'Transient Error'} | |
| #Set disks to retired state | |
| $disks | Select-Object UniqueId | ForEach-Object { | |
| Set-PhysicalDisk -UniqueId $PSItem.UniqueId -Usage Retired | |
| } | |
| #remove disks from pool | |
| $disks | ForEach-Object { | |
| Remove-PhysicalDisk -PhysicalDisks $PSItem -StoragePoolFriendlyName 'S2D on HVCL0' -Confirm:$false |
This file contains hidden or 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
| PS> Get-AdmPwdPassword -ComputerName SomeComputer | |
| ComputerName DistinguishedName Password ExpirationTimestamp | |
| ------------ ----------------- -------- ------------------- | |
| SomeComputer CN=SomeComputer,OU=TestBed,OU=Ser... ; 5G#cnz94&;Oq1 29.09.2017 13:30:42 |
This file contains hidden or 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 hidden or 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 hidden or 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
| Import-Module AdmPwd.PS | |
| Update-AdmPwdADSchema |