Convert vhd to vhdx

Downloaded a vhd from azure added it to gen1 vm however only showed blinking cursor Created gen 2 vm however could not add the vhd issue reading it Converted vhd to vhdx and was able to boot On VM setting go to disk Edit Choose action Convert select VHDX set type fixed or dynamic set location finish on hyper v settings edit disk browser to disk Choose action Convert select VHDX set type fixed or dynamic set location finish...
Read More

Reset password on activate directory via powershell

Single user Set-ADAccountPassword –Identity useralias–Reset –NewPassword (ConvertTo-SecureString -AsPlainText "Newp@ssw0rd" -Force)   Multiple Users csv with heading SamaccountName and the new password $UserFile = "C:\Temp\MultiUser.CSV" Foreach ($User in $UserFile) { $SamAccountName = $User .SamAccountName $ThisPassword = $User .Password Set-ADAccountPassword –Identity $SamAccountName –Reset –NewPassword (ConvertTo-SecureString -AsPlainText "$Password" -Force) }...
Read More

Using Certify the web for lets encrypt certificates

Go to cloudflare and login click profile icon select my profile go to api tokens tab create new custom token Give token a name give the following permissions Zone Zone Edit Zone DNS Edit Zone Resources Include all zones IP Address filtering none (unless you wanted to restrict access, I have not as my IP is dynamic) TTL Blank Continue to summary Create token Copy API Token Install Certify the web application https://certifytheweb.com/home/ For authentication we will use DNS verification via Cloudflare API On Certify the web go to Settings stored credentials add new stored credentials Select Cloudflare DNS API Set credentials name to easily identify fill in the api token in the api token field click save   on manage certificates page new certificate click okay on prompt about registering a new contact select certificate authority of lets encrypt enter email address,( notify you of upcoming renewals if required, invalid email addresses will be rejected by certificate authority Agree to the terms click register contact   On new certificate window leave slecte site as no IIS side selected add the required domain name and click + Go to authorization tab change challenge type to dns-01 DNS update method - cloudflare...
Read More

Bulk update VHD Location on Hyper-V Host

used for is you have already moved the files, for instance I updated from using the computer name \\storage\ to the FQDN   get Excel file get-VMHardDiskDrive -VMName * | select VMName,ControllerType,ControllerNumber,ControllerLocation,Path | Export-Csv -Delimiter ";" -Path "c:\temp\vmvhdloc.csv" In excel file update path to what you want it to be (note this does not move the file) import-csv c:\temp\vmvhdloc.csv | ForEach-Object { set-VMHardDiskDrive -VMName $_.VM -ControllerType $_.CT -ControllerNumber 0 -ControllerLocation $_.CL -Path $_.newpath } get-vm * | Get-VMHardDiskDrive  ...
Read More

Virtual disk does not mount after restarting server

Either when you reinstall OS or add a new drive it seems to of disabled auto mount Confirm you have read/write access on the server you on Server Manager->File and Storage Services->Volumes->Storage Pools Right-click storage pool and choose “Set Read-Write access" and OK on the prompt Set drive to automatically mount in powershell Get-VirtualDisk | select friendlyname,ismanualattach friendlyname ismanualattach ------------ -------------- 4TB True 2TB False Front Bay False Msata False Update all disk to be auto get-VirtualDisk | Set-VirtualDisk -IsManualAttach $False Confirm check applied Get-VirtualDisk | seect friendlyname,ismanualattach friendlyname ismanualattach ------------ -------------- 4TB False 2TB False Front Bay False Msata False...
Read More

Windows Server 2019 – shutdown event tracker shows at every login when RDP to server

While I was building a new server in which I was using storage pools I rebooted the system to check that the drives auto mounted, while doing this I found that I kept getting the shutdown event tracker when I logged in and it did not go away (this even occurred when using restart option) I look online for other things and found that someone else had this issue for 2016 and 2019, The solution open registry go to \HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Reliability backup .\DirtyShutdown .\DirtyShutdownTime Then delete those values...
Read More

Failover Cluster manager – get list of Vm’s and if a VM has a DVD (iso file)

Powershell Get-ClusterGroup -Cluster 19-hv | ? {$_.GroupType –eq 'VirtualMachine' } | Get-VM | Get-VMDvdDrive   19-hv is the cluster name I have created VMName ControllerType ControllerNumber ControllerLocation DvdMediaType Path ------ -------------- ---------------- ------------------ ------------ ---- 19-RDSH SCSI 0 1 None 2016DC-1 SCSI 0 1 None 2019 SCSI 0 1 None Android IDE 1 0 ISO \\fs1\OS\Linux\android-x86-5.1-rc1.iso AzureADConnect2 SCSI 0 1 None CentOS-G1 IDE 1 0 None Domonitor SCSI 0 1 None exchange IDE 1 0 None FireflyIII IDE 1 0 None G2-testboot SCSI 0 1 None GMVault SCSI 0 1 None GW2 SCSI 0 1 None JenkinsTestServer IDE 1 0 None LanSweep SCSI 0 1 None leSSL1 IDE 1 0 None MCS2(Toms Server) IDE 1 0 None MCS3 SCSI 0 1 None MCS4 SCSI 0 1 None Mgmt1 SCSI 0 1 None MineOS-G1 IDE 1 0 None Observium SCSI 0 1 None ODSPSync SCSI 0 1 None PFsense SCSI 0 1 None PFSenseG1 IDE 1 0 None Proxmox-G1 IDE 1 0 None SharePoint 2019 SCSI 0 1 None Sharepoint1 SCSI 0 1 None SQL SCSI 0 1 None Steam-Cache SCSI 0 1 None SYSDeploy SCSI 0 2 None SYSDEPLOY1 IDE 1 0 None SYSWebM1 IDE 1 0...
Read More

Office 365 – Azure backup remove recovery services vault

Within Azure I used the Azure Backup server I unregsitered the server I was using however backup items still displayed which prevent me removing the vault solution was to go to manage > backup infrastructure then under management servers click on Backup mananagement server and remove from there. If it is a single server backup under backup ingrastructure go to protected servers (azure backup agent) select server and choose delete Once removed you can then delete the recovery vault...
Read More