Powershell: How to re-provsion the sync DB to resolve the issue that User Profile Synchronization Service fails to start?

You can use the below script: ================================== Get-SPDatabase $syncdb=Get-SPDatabase -Id$syncdb.Unprovision()$syncdb.Status=’Offline’Get-SPServiceApplication$upa=Get-SPServiceApplication – Id$upa.ResetSynchronizationMachine()$upa.ResetSynchronizationDatabase()$syncdb.Provision()  

0

Powershell: How to restart the User Profile Synchronization Service if disabled?

Below script shows how to restart the User Profile Synchronization Service if disabled.   ============================================ # Loads the SharePoint 2010 PowerShell extensions Add-PSSnapIn Microsoft.SharePoint.PowerShell  # Sets variable for User Profile Service Application: enter the name of your UPA in quotes, replacing the “UPA” example$upa = Get-SPServiceApplication |?{$_.displayname -eq “UPA”}# Sets variable for service instance: enter…

3

CPP: How to wait on a job object?

This is the sample code in CPP to show how to wait on a job object. In the documentation:   The state of a job object is set to signaled when all of its processes are terminated because the specified end-of-job time limit has been exceeded. Use WaitForSingleObject or WaitForSingleObjectEx to monitor the job object…

0

Error "The certificate enrollment page you are attempting to access cannot be used with this version of Windows" after MS11-051 patch installation

Symptom: You have Windows Server 2003 with installed Certification Authority and Web Enrollment components. When you try to access web enrollment pages from a Windows Vista-based (or newer) computer you receive error: The certificate enrollment page you are attempting to access cannot be used with this version of Windows. To enable Web certificate enrollment for clients…

2

How to query network adapter for IPv6 protocol?

Assuming you need it in script, PowerShell: # computername $MachineName = ‘localhost’   # open HKLM reg on $MachineName $reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey(‘LocalMachine’, $MachineName)   # open subKey SYSTEMCurrentControlSetservicesTCPIP6Linkage $regKey = $reg.OpenSubKey(“SYSTEM\CurrentControlSet\services\TCPIP6\Linkage”)   # get the values from the name ‘Bind’ # e.g. Device{A2B312D5-A133-4779-B21B-5B3ED82B6DCF} $bind = $regKey.GetValue(“bind”)   # get adapters that are IP enabled :…

0

C# – How to load DLL in separate domain and use its methods?

Sometimes you may have a need to load a DLL in a separate domain to call its method at run-time. You can create a proxy class by referencing the following code snippet: public class Loader : MarshalByRefObject { object CallInternal(string dll, string typename, string method, object[] parameters) { Assembly a = Assembly.LoadFile(dll); object o = a.CreateInstance(typename);…

4

Word 2010 switches to Draft view from Print Layout view when the computer is left idle for a couple of minutes

Some Word2010 users reported an interesting issue: You are viewing a document (with reviewing turned on) in Print Layout view, and after a few minutes, the view switches to Draft view and opens the comments window on the bottom. It usually happens when the computer is left idle for a couple of minutes or sometime seconds….

49

A Windows Live error occurred while provisioning for "mail@domain.com". An internal error occurred while talking to Windows Live

Symptom: You’ve implemented federation (AD FS) in your on-premises organization. You are doing a staged Exchange Migration (using a CSV file). You have migrated a couple of mail boxes from on-premises Exchange server to Plan E3.  But you start getting error: A Windows Live error occurred while provisioning for “mail@domain.com“. An internal error occurred while talking to Windows Live….

0

Script error when attempting to load album/track information in Windows Media Player 12

Sometimes you may encounter the script error when you attempte to load album/track information in WMP12. For example: An error has occurred in the script on this page Line: 240 Character: 25 Error: Object expected Code: 0 URL: http://fai.music.metaservices.microsoft.com/FAI/AlbumMatch.aspx?locale=409&geoid=f4&version=12.0.7601.17514&userlocale=409&requestid=830A4FFD-F3A3-4AD9-A1FA-390A48236E10 Do you want to continue running scripts on this page? Yes or No.   Causes: In…

6

How to determine if current user is a domain or local user?

Assuming you need it in script, PowerShell:   (gwmiWin32_LogonSession).GetRelated(“Win32_UserAccount”)   If you expect more than one logon session, then   (gwmi Win32_Process -filter “Handle = $Pid”).GetRelated(“Win32_LogonSession”) |% {$_.GetRelated(“Win32_UserAccount”)}   will give you Win32_UserAccount for the account used to run current powershell instance.

3