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
| get-cluster | Get-VMHost | Get-VMHostStorage -RescanAllHba -rescanvmfs | |
| $datastore = get-datastore "DATASTORE-NAME" | |
| $esxi = get-view -id ($datastore.ExtensionData.Host | select-object -last 1 | select -ExpandProperty Key) | |
| $datastoresystem = get-view -id $esxi.ConfigManager.DatastoreSystem | |
| $expandOptions = $datastoreSystem.QueryVmfsDatastoreExpandOptions($datastore.ExtensionData.MoRef) | |
| $datastoreSystem.ExpandVmfsDatastore($datastore.ExtensionData.MoRef,$expandOptions.spec) |
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
| REM Convert guest VM from EFI to BIOS boot, grow disk, etc. before doing this | |
| REM Boot to appropriate Windows Server install media and open repair command prompt | |
| diskpart | |
| select disk 0 | |
| list partition | |
| select partition 1 | |
| assign | |
| select partition 2 | |
| assign | |
| list volume |
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
| get-credential | export-clixml -path "C:\foo\bar\credential.xml" |
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
| install-windowsfeature -name web-server -includemanagementtools | |
| remove-item c:\inetpub\wwwroot\iisstart.htm | |
| add-content -path "C:\inetpub\wwwroot\iisstart.htm" -value $("Hello World from $($env:computername)") |
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
| Reg Add HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics /v "16 LDAP Interface Events" /t REG_DWORD /d 2 |
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
| Connect-MsolService -Credential (Get-Credential) | |
| $licensedMSOLUsers = Get-MsolUser -MaxResults 5000 | ? {$_.islicensed -eq $true} | |
| ($licensedMSOLUsers) | ? {$_.licenses.accountskuid -notcontains "office365tenant:EMS"} |
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
| (Get-VBRProtectionGroup -name "Protection Group Name").container.entity | % {$_.name} |
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
| get-cluster 'clustername' | Get-VMHost | Foreach {Start-VMHostService -HostService ($_ | Get-VMHostService | Where { $_.Key -eq "TSM-SSH"} )} |
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
| # useful for systems that don't want a whole PEM file | |
| openssl pkcs12 -in windows-pfx-export.pfx -out exported-pem.pem -nodes | |
| openssl rsa -in exported-pem.pem -out private.key | |
| openssl x509 -outform pem -in exported-pem.pem -out certificate.cer |
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
| bind ssl serviceGroup ServiceGroup_Name -cipherName CipherGroup_BestPractices | |
| unbind ssl serviceGroup ServiceGroup_Name -cipherName DEFAULT_BACKEND |