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
$VMName = "PIXEL-SRV01" | |
[int64]$VMMem = 1MB*1024 #chnage to 1gb* the number of gb if you need. | |
$VMGen = "2" | |
$VHDPath = "V:\Hyper-V\$VMname\Virtual Hard Disks\$VMName.VHDX" | |
$VMPath = "V:\Hyper-V\" | |
[int64]$VMSize = 1GB*40 | |
$ISOPath = "C:\ISO\en_windows_server_2016_x64_dvd_9327751.iso" | |
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
Enter-PSSession -ComputerName PIXEL-NANO10 | |
Import-Module iis* | |
New-IISSite -Name "TestPixels" -BindingInformation "*:80:" -physicalPath "c:\inetpub\wwwroot\TestPixels" |
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
Enable-ADOptionalFeature "Privileged Access Management Feature" -Scope ForestOrConfigurationSet -Target pixelrobots.co.uk | |
Get-ADGroupMember "Domain Admins" | |
Add-ADGroupMember -Identity "Domain Admins" -Members "Ian" -MemberTimeToLive (New-TimeSpan -Minutes 30) | |
Get-ADGroup "Domain Admins" -Property member -ShowMemberTimeToLive |
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
#changing PIXEL-DC01 to a name of the domain controller you want to push replication from. | |
Repadmin /syncall PIXEL-DC01 /APed |
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
Enter-PSSession -ComputerName PIXEL-NANO10 | |
Install-NanoServerPackage Microsoft-NanoServer-Storage-Package -Culture en-us | |
shutdown /r /t 10 | |
Exit-PSSession | |
Enter-PSSession -ComputerName PIXEL-NANO10 | |
New-Item -Name Share -Path c:\ -Type directory | |
New-SmbShare -Name share -Path c:\Share | |
Get-SMBShareAccess share | |
Grant-SmbShareAccess -Name share -AccountName ad.testpixels.co.uk\richard.hooper -AccessRight change | |
revoke-SmbShareAccess -Name share -AccountName everyone |
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 ActiveDirectory | |
Enable-ADOptionalFeature -Identity ` | |
'CN=Recycle Bin Feature,CN=Optional Features,CN=Directory Service,CN=Windows NT,CN=Services,CN=Configuration,DC=pixelrobots,DC=co,DC=uk' ` | |
-Scope ForestOrConfigurationSet -Target 'pixelrobots.co.uk' |
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
Test-ADDSDomainControllerUninstallation -DemoteOperationMasterRole -RemoveApplicationpartitions | |
Uninstall-ADDSDomainController -DemoteOperationMasterRole -RemoveApplicationpartitions |
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
Test-ADDSDomainControllerUninstallation -DemoteOperationMasterRole -RemoveApplicationpartitions | |
Uninstall-ADDSDomainController -DemoteOperationMasterRole -RemoveApplicationpartitions |
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
#Find who has the FSMO Roles | |
netdom query fsmo | |
#Move FSMO Roles | |
Move-ADDirectoryServerOperationMasterRole -Identity PIXEL-DC03 -OperationMasterRole SchemaMaster, DomainNamingMaster, PDCEmulator, RIDMaster, InfrastructureMaster | |
#Check that the move went well | |
Netdom query fsmo |
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 ADDS and all management tools | |
Write-Host "Installing ADDS" | |
Add-WindowsFeature -Name “ad-domain-services” -IncludeAllSubFeature -IncludeManagementTools -verbose |
OlderNewer