Powershell Scripts

Home/Microsoft/Powershell Scripts

PowerShell Script to Join Server to AD Domain

The below PowerShell script can be used to Join Windows Server to Active Directory Domain #!powershell# Setup Key Values###################################$AD_DEPLOYMENT_ID = "YourLogin"$AD_DEPLOYMENT_PASSWORD = "YourPassword"$AD_DOMAIN_TO_JOIN = "knowledgeascent.com"$AD_DOMAIN_OU = "OU=trainingscripts,DC=knowledgeacent,DC=com"$HOSTNAME = $env:computername# Join SERVER to AD Domain###################################$cred = New-Object System.Management.Automation.PsCredential("$AD_DEPLOYMENT_ID", (ConvertTo-SecureString "$AD_DEPLOYMENT_PASSWORD" -AsPlainText -Force))write-host " " write-host "Join Server $HOSTNAME to domain $AD_DOMAIN_TO_JOIN" -ForegroundColor Yellowwrite-host " "Add-Computer [...]

2017-11-30T17:00:31-05:00July 21st, 2017|Microsoft, Powershell Scripts|0 Comments

Powershell Script to Add DNS Records to Server Network

The Below Powershell script will Add DNS Records to Server Network. #!powershell ##################################################### # Set DNS on Server # ##################################################### Example: $DNS1="10.220.13.10" $DNS2="10.220.13.11" Set-DnsClientServerAddress -InterfaceAlias '*' -ServerAddresses($DNS1, $DNS2)

2017-07-21T14:29:26-04:00July 20th, 2017|Microsoft, Powershell Scripts|0 Comments

PowerShell Script to Add Domain Group to Local Administrators Group

The below PowerShell script will Add an Active Directory Domain Group to Computer Local Administrators Group. #!powershell# Setup Key Values###################################$GrouptoAdd = "YourGroupName"# Adding Domain Group to Local Administrator Group##################################################write-host " " write-host "Adding Domain Group $GrouptoAdd to Local Administrator Group" -ForegroundColor Yellowwrite-host " "$GroupObj = [ADSI]”WinNT://localhost/Administrators”$GroupObj.Add(“WinNT://knowledgeascent.com/$GrouptoAdd”) 

2017-11-30T17:26:55-05:00July 20th, 2017|Microsoft, Powershell Scripts|0 Comments

Powershell Script to silent install McAfee Agent

The Below Powershell script will download your McAfee Antivirus Agent from your local server and execute a silent install for the agent. #!powershell# Setup Key Values###################################$URL="http://yourmcafeeserver//PROD_WIN_ePO_Agent_FramePkg.exe"$downloadtargetpath= "C:\temp\PROD_WIN_ePO_Agent_FramePkg.exe"# Forece TLS 1.2 ###################################[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12write-host " " write-host "Download McAfee Binaries from: $URL" -ForegroundColor Yellowwrite-host " "try {   Invoke-WebRequest -UseBasicParsing $URL -OutFile $downloadtargetpath -ErrorAction [...]

2017-12-01T20:47:15-05:00July 20th, 2017|Microsoft, Powershell Scripts|0 Comments

About me

I have more than 15 years hands-on experience in the IT field. The majority of my work is in networking, operating systems and applications and storage. I carry industry certifications in Redhat, Microsoft, EMC, VMWare, VCE and ITIL.

I find it hard to find procedures or documents on how to implement specific technology and this is how the decision to create a place to share my knowledge and ideas for anyone interested in the same subject.

If you have the same vision and you are interested to publish on this website please contact me and I will create an account for you.

Certifications:
RHCSA

Certifications:
MCSE Security
MCSA Massaging

Certifications:
EMCIE- Isilon
EMCTA- Isilon
EMCIE- VNX

Certifications:
VCP-DCV

Certifications:
VCE-CIA

Certifications:
TITL

This site is targeting Solution Architects, Implementation Engineers and Systems Administrators. It is not targeting sales or intending to promote any specific technology or vendor.

The focus is on hands-on work, technical documentations and architecting solutions.

The site reflects my knowledge and opinions, I do recommend that you test what you learn in the lab environment before implementing it in production.

If you have a doubt call technical support, I do not assume any liability for any errors or omissions in those articles, I also make no representations as to the accuracy or completeness of any information on this site or found by following any link on this site

Content published here is tested in my own lab and is not reviewed or approved by any vendor.

If you have any issues with your system I highly recommend you contact the technical support of the vendor.

Disclaimer

Knowledge Ascent (KA) makes information available on its web site to enhance public knowledge and promote a better understanding of the IT environment. KA attempts to provide accurate, complete, and timely information. KA, however, cannot guarantee the quality, content, accuracy, or completeness of the information, text, graphics, links, and other items contained on its web pages because the material comes from a variety of sources, collected and maintained for different purposes. KA also retains the right to change any content on its web site without prior notice.

Information provided on the KA web site should not be used as a substitute for IT or other professional advice. KA assumes no liability for any damages or loss of any kind that might arise from the use of, misuse of, or the inability to use the KA web site and/or the materials contained on the web site. KA also assumes no liability for improper or incorrect use of materials or information contained on its web site. All materials that appear on the KA web site are distributed and transmitted "as is," without warranties of any kind, either express or implied, and subject to the terms and conditions stated in this disclaimer.

Contact Me
FAQ
Go to Top