by spjeff

Query remote User Profile with PowerShell and REST API

April 9, 2015 by spjeff

The below code leverage SharePoint 2013 REST /_api/ to get User Profile detail remotely.   WebClient issues the HTTP GET and saves XML response.   Parsing XML gives full profile detail which can be exported or saved with other functions.   Hope this helps!  shades_smile

 

NOTE – Remember to replace “sharepoint2013” with target farm DNS and “domain\” with Active Directory domain.

 

by spjeff

IISFlush.ps1

April 6, 2015 by spjeff

While troubleshooting an error with Excel Web Access I found recycle wasn’t sufficient and IISRESET was needed.   However, this raised questions about daily scheduled IIS recycle and if that would be enough to give a stable IIS footprint each business day.   I decided to err on the side of caution and schedule a full IISRESET along with code to ensure all sites and pools started up again OK.   PowerShell below.  

 

Also, I would recommend installing SPBestWarmUp (http://spbestwarmup.codeplex.com)  by running “spbestwarmup.ps1 –install”    This creates a Scheduled Task repeating every 15 minutes to simulate user traffic and keep those IIS pools responsive for end users.   No more wait on first visit.   It even warms up Central Admin to help out SharePoint admins.  

 

Enjoy!  shades_smile

 

by spjeff

Test if GAC assembly exists with PowerShell

April 3, 2015 by spjeff

Recently I was troubleshooting a SharePoint health analyzer message about missing GAC DLL assembly.   Some servers in the farm had the DLL while others did not.  The below PowerShell one-liner helped me run a test on each server to load the GAC DLL and verify if it was installed.   Hope this helps others too!   shades_smile

 

Code

 

References