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 […]
Get-DnsServerZone | ForEach-Object { Get-DnsServerResourceRecord -ZoneName $_.ZoneName -RRType Ns | Where-Object {$_.RecordData.NameServer -like ‘DCName.fqdn.com.‘} | 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.
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 […]
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 […]
Are your alerts behind or ahead by an hour? Microsoft has created a PowerShell script to automatically update your alerts for daylight savings time. http://technet.microsoft.com/en-us/library/cc508847.aspx 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 […]
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 […]
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. […]
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 […]