View Azure Stack Polices.ps1
get-cloudrive
invoke-webrequest https://github.com/Azure/AzureStack-Tools/archive/master.zip -OutFile master.zip
expand-archive master.zip -DestinationPath . -Force
cd AzureStack-Tools-master
Import-Module .\Policy\AzureStack.Policy.psm1
Get-AzureRMSubscription
View Domain.json
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"adminUsername": {
"type": "string",
"metadata": {
"description": "The name of the administrator account of the new VM and domain"
}
},
View Hyper-V_Groups.ps1
# Create new VM Group
New-VMGroup -Name "BackEnd" -GroupType VMCollectionType -Verbose
# Add VMs to VM Collection Group
Add-VMGroupMember -Name "BackEnd" -VM (Get-VM "SQL01"),(Get-VM "SQL02")
# Verify Group Members
(Get-VMGroup -Name "BackEnd").VMMembers
# Find group VM is member of
View backup_and_delete_unlinked_gpos.ps1
.SYNOPSIS
Script used to find all unlinked gpos, back them up and then delete them.
.DESCRIPTION
The script searches your logged on domain for unlinked GPO's. It then backs them up to a folder on the C:\. It will then remove them. It also creates a log file in the same directory.
.LINK
http://www.pixelrobots.com
#>
View Nano_Install_Package.ps1
Enter-PSSession -ComputerName PIXEL-NANO01
Install-PackageProvider NanoServerPackage
Import-PackageProvider NanoServerPackage
Find-nanoserverPackage -name *
Install-NanoServerPackage -name Microsoft-NanoServer-IIS-Package -Culture en-us
View Set-ClusterQuorum.ps1
Set-ClusterQuorum -CloudWitness -AccountName <storageAccountName> -AccessKey <StorageAccountAccessKey>
View Install_ADDS_and_Add_To_Forest.ps1
# Install ADDS and all management tools
Add-WindowsFeature -Name “ad-domain-services” -IncludeAllSubFeature -IncludeManagementTools
# Add Domain Controller to existing Forest
write-Host "Add Dc to existing Forest"
$domainname = Read-Host "Enter Domain Name you want to join eg: ad.contoso.com"
$sitename = read-host "Enter name of site to join. eg: Default-First-Site"
Import-Module ADDSDeployment
Install-ADDSDomainController `
-NoGlobalCatalog:$false `
-CreateDnsDelegation:$false `
View Add_Reverse_DNS_Lookup_zone.ps1
### Add Reverse DNS Looup Zone
$rDNS = read-host "Enter Reverse DNS network ID eg: 10.10.10.0/24"
Add-DnsServerPrimaryZone -NetworkId:$rDNS -ReplicationScope Forest
View Add_Subnet_to _Sites&Services.ps1
# Add subnet to sites and service
Write-Host "Add Subnet to Site"
$Subnet = read-host "Enter subnet in format 10.10.10.0/24"
$desc = read-host "Enter description eg: 10.10.10.0/255.255.255.0"
New-ADObject -Name:$subnet -Type subnet -Description:$desc -OtherAttributes @{location="Yellow-Pixel";siteObject="CN=Yellow-Pixel,CN=Sites,CN=Configuration,DC=ad,DC=testpixels,DC=co,DC=uk"} -Path "CN=Subnets,CN=Sites,CN=Configuration,DC=ad,DC=testpixels,DC=co,DC=uk"
View Rename_Default_First_site.ps1
# Change Default-First-Site-Name
Write-Host "Change Name of Default-First-Site"
$Sitename = read-host "Enter new site name to replace Default-First-Site"
$configNCDN = (Get-ADRootDSE).ConfigurationNamingContext
$siteContainerDN = ("CN=Sites," + $configNCDN)
$siteDN = "CN=Default-First-Site-Name," + $siteContainerDN
Get-ADObject -Identity $siteDN | Rename-ADObject -NewName:$sitename