Powershell – Clear all event logs in Windows 2012 R2 Server
The Below Powershell command will clear all even logs from a Windows Server 2012 R2. wevtutil el | Foreach-Object {wevtutil cl "$_"}
The Below Powershell command will clear all even logs from a Windows Server 2012 R2. wevtutil el | Foreach-Object {wevtutil cl "$_"}
The Below PowerShell script can be used Remove (Unjoin) Windows Server from Active Directory Domain #!powershell# Setup Key Values###################################$AD_DEPLOYMENT_ID = "YourLogin"$AD_DEPLOYMENT_PASSWORD = "YourPassword"$AD_DOMAIN_TO_UNJOIN = "knowledgeascent.com"$HOSTNAME = $env:computername# Remove SERVER from AD Domain###################################$cred = New-Object System.Management.Automation.PsCredential("$AD_DEPLOYMENT_ID", (ConvertTo-SecureString "$AD_DEPLOYMENT_PASSWORD" -AsPlainText -Force))write-host " "write-host "unjoin Computer $HOSTNAME from domain $AD_DOMAIN_TO_UNJOIN" -ForegroundColor Yellowwrite-host " "Remove-Computer -ComputerName $HOSTNAME -UnjoinDomainCredential [...]
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 [...]
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)
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”)
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 [...]
Windows SID Windows security identifier (SID) is a unique value of variable length used to identify a trustee. Each account has a unique SID issued by an authority, such as a Windows domain controller, and stored in a security database. To Get the SID for an account we can use the normal Windows command line [...]
emcopy version 4.17 supports converting old historical SID to new SID using sidmapfile switch, This is a great feature for CIFS/SMB migration especially that we can now convert all the old broken SID’s to new active SID’s while we are executing the emcopy file migration. In this exercise we will demonstrate how to construct the sidmap file [...]
How to Translate EMCopy error codes Before running emcopy to migrate data in production environment, it is always recommended to execute multiple test runs to solve all authentication and permissions errors. There are two ways to check for EMCopy error codes: Using Windows MSDN link below that will reference how to read those errors: Windows Error [...]
Introduction to Windows Active Directory Groups: Using Windows Active directory groups makes it more efficient for the operating system to enumerate permissions on an ACL, and makes it also easier for the company operations staff to manage all the ACL permissions on the resource. The file server must enumerate each user account SID number in [...]