Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Windows Server Setup; perform common tasks on a fresh server
# Install Google Chrome (code downloaded from another Gist)
Invoke-Expression ((Invoke-WebRequest "https://gist.githubusercontent.com/dansmith65/4c012304ed96596dbbcad8e4a15f7583/raw/Install-GoogleChrome.ps1").Content)
# Install Nodepad++ (code downloaded from another Gist)
Invoke-Expression ((Invoke-WebRequest "https://gist.githubusercontent.com/dansmith65/a862f301fce553b26db9689ad0f87b6a/raw/Install-NotepadPlusPlus.ps1").Content)
# Install 7-zip (code downloaded from another Gist)
Invoke-Expression ((Invoke-WebRequest "https://gist.githubusercontent.com/dansmith65/7dd950f183af5f5deaf9650f2ad3226c/raw/Install-7zip.ps1").Content)
# Install AWS CLI (code downloaded from another Gist)
Invoke-Expression ((Invoke-WebRequest "https://gist.githubusercontent.com/dansmith65/79275f15fe25550e65ccd4d6bf1448cf/raw/Install-AWSCLI.ps1").Content)
# Set Timezone
Set-TimeZone -Name "Pacific Standard Time"
$credential = Get-Credential -Message "Add non-admin account"
if ($credential) {
if (-not($credential.GetNetworkCredential().Password)) {
Write-Host "no password entered, so account was not created"
} else {
$account = New-LocalUser -Name ($credential.UserName) -Password ($credential.Password) -AccountNeverExpires -PasswordNeverExpires
if ($account) {
Write-Host "account created: $($credential.UserName)"
# Could alternatively only add user to "Remote Desktop Users" group
Add-LocalGroupMember -Group "Administrators" -Member ($credential.UserName)
Write-Host "Might want to disable the built-in Administrator user:"
Write-Host " Disable-LocalUser -Name Administrator"
}
}
$credential = $null
}
@dansmith65

This comment has been minimized.

Copy link
Owner Author

dansmith65 commented Oct 25, 2018

Paste this one line into PowerShell to download the script from github and run it:

Invoke-Expression ((Invoke-WebRequest "https://gist.githubusercontent.com/dansmith65/010e9ae85a09ce9855206b7558a67b37/raw/WindowsServerSetup.ps1").Content)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.