Removing locally installed printers and replacing with print server

Recently ran into an environment where there was a print server installed and managing all 200 printers however some users (380 computers) still had printers installed locally and were printing directly to the printer through the IP address or host name. This can cause issues with permissions, driver updates, or logging. Instead of manually touching […]

Remove DNS NS Records after demoting domain controller with PowerShell

  Get-DnsServerZone | ForEach-Object { Get-DnsServerResourceRecord -ZoneName $_.ZoneName -RRType Ns | Where-Object {$_.RecordData.NameServer -like ‘‘} | Remove-DnsServerResourceRecord -ZoneName $_.ZoneName -Confirm:$false }   Replace the bold test with the fully qualified domain name of the name server. Don’t forget to keep the period at the end of it as well.

SharePoint – Export All Documents on Site and Sub-Sites

  I was eliminating a site on SharePoint that had over 50 sub-sites. I wanted an easy way to get all the documents in each site without having to manually visit each one. Here is an easy PowerShell script I came up with. 1: #Created by Brandon Claps 2: #9/25/14 3: #Exports all documents under […]

Configuring alarms on all VMware alarm definitions automatically using PowerShell

  My example contains alarm actions to send an email, but you can configure this for SNMP or any other actions. You can copy and paste this into a “.ps1” file to create a PowerShell scripts. # This command will remove any alarms actions that are configured currently. Get-AlarmDefinition | Get-AlarmAction | Remove-AlarmAction -confirm:$false   […]

SharePoint 2010 Alerts – Daylight Savings Time (DST)

  Are your alerts behind or ahead by an hour? Microsoft has created a PowerShell script to automatically update your alerts for daylight savings time. You’ll want to make sure you’re running the script as a SharePoint administration from within the SharePoint Management Shell. Add the PowerShell script to the scope . ./Invoke-AlertFixup.ps1 (make […]

SharePoint 2010: Unable to Display This Web Part. Error while executing web part: System.StackOverflowException: Operation caused a stack overflow.

  This was caused by the XsltTransformTimeout when using an Xslt list view. This is corrected by installing the February 2012 Cumulative Update and by making the following change via PowerShell. Check Current Setting $farm = Get-SPFarm $farm.XsltTransformTimeOut The default setting is 1 second. The PowerShell code below changes it to 5 seconds which should […]

Schedule Update-SPProfilePhotoStore

  Create a PowerShell script with the following. Make sure your MySite host location is correct. Add-PSSnapin Microsoft.SharePoint.PowerShell Update-SPProfilePhotoStore -CreateThumbnailsForImportedPhotos 1 -MySiteHostLocation http://mysitehostlocation/MySite/ Save the file as a .ps1 file on your SharePoint 2010 server – C:\Scripts\UpdateSPPhotos.ps1 Create a daily scheduled task on the SharePoint 2010 server that runs at the SharePoint Farm Administrator account. […]

Check Windows Service Status with PowerShell

I needed a way to watch a service and if it was stopped to start it. I created this PowerShell script to check it, start it and create a log, using it in a scheduled task. Make sure the service name is the name of the actual service and not the display name for the […]