Friday, June 22, 2012

Get Template Used by Site

$site_where_template_is_needed = get-spweb "http://rooturl/sites/sitename"

write-host $site_where_template_is_needed.webtemplate




Site Templates: get-spwebtemplate

Tuesday, June 19, 2012

UserProfileApplication.SynchronizeMIIS: Failed to configure ILM, will attempt during next rerun. Exception: System.Data.SqlClient.SqlException

RUN AS FARMADMIN!!!!!

$sync_db = "PROD_SA_UPS_Sync"
$ups_service_app_name = "User Profile Service"



net stop sptimerv4
$syncdb=Get-SPDatabase | where {$_.Name -eq $sync_db}
$syncdb.Unprovision()
$syncdb.Status='Offline'
$ups = Get-SPServiceApplication  | where {$_.Displayname -eq $ups_service_app_name }
$ups.ResetSynchronizationMachine()
$ups.ResetSynchronizationDatabase()
$syncdb.Provision()
net start sptimerv4

Start the UserProfileSyncService again

Monday, June 18, 2012

Stop all Incoming Mail Services

Get-SPServiceInstance | ? {$_.Typename -eq "Microsoft SharePoint Foundation Incoming E-Mail"} | Stop-SPServiceInstance -Confirm:$False