Tuesday, May 24, 2016

Reconnecting Deleted Users on O365

If the Directory  Sync connection between an Office 365 and AD account breaks for some reason (AD user is deleted, server corruption etc) it can be tricky to get them reconnected. These steps may help:
1) Use Office 365 Control panel to restore deleted user.  It will now be marked as “In Cloud” instead of “Synced with Active Directory”.
2) Use the local AD tools to re-create user if it is missing. Local Exchange tools should be used to create a new mail user with an SMTP address that matches the SMTP address of the Office 365 User.
3) Fire up Powershell and connect to the Office 365 Azure Cloud using the following commands:
Import-Module MSOnline 
$O365Cred = Get-Credential 
$O365Session = New-PSSession –ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell -Credential $O365Cred -Authentication Basic -AllowRedirection 
Import-PSSession $O365Session -AllowClobber 
Connect-MsolService –Credential $O365Cred
4) Use the following command to delete the ImmutableID from the Office 365 Account where ‘User Principal Name’ is either the name or the email address of the user being reset:
Set-MsolUser -UserPrincipalName 'User Principal Name' -ImmutableId '$null'
5) Wait for, or force, the AD Sync and it should reconnect the accounts.

Monday, November 16, 2015

Replication Group Error after SCCM Primary Site Recovery

I encountered a freak issue done by one of our Field IT guys. Well, he un-installled the SQl server that is being used the Primary Site SCCM Server . How is that possible? Well, I seriously do not have the answer for that. Fortunately, we have a working copy of the SCCM backup and so I went about performing the dreaded site recovery. (This part will be cover this in a separate post)
After some time, I managed to recovery the site but just when I was hoping to get some rest, I realized that the database replication between this Primary Site Server and the CAS failed.

The error was found in the rcmctrl.log is "Error: Replication group "General_Site_Data" has failed to initialize for subscribing site C00, setting link state to Error."



To resolve this, the steps are as below
1) Launch SQL server management studio with an account with sysadmin rights
2)  Run the TSQL command below to check the state of replication
select * from RCM_DrsInitializationTracking 
 where replicationGroup = 'General_Site_data' AND SiteFulfilling='P02'

3) To resolve the issue, run the TSQL command below

update RCM_DrsInitializationTracking set InitializationStatus = 7 where ReplicationGroup = 'general_site_data' and SiteRequesting = '<Central Site Code>' and SiteFulfilling = '<Primary Site Code>'

Run the replication link analyser again to check on the status.

Enable verbose logging for SCCM 2012



SCCM logging by default do not provide you with detailed information for you to do advanced analysis. To do so, you will need to enable Verbose / Debug or NAL. This logging will give you much more detailed information, and it will help you location the root of the problem.

Server verbose logging:

1 – open means

0 – off means

SCCM and components:

HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ SMS \ Tracing \ ENABLED = 1 – (REG_DWORD – General SCCM turn on Logging)

HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ SMS \ Tracing \ xxxxxxx \ Enabled = 1 – (REG_DWORD – The Role SCCM’de If you change the compositions according to him)

HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ SMS \ Tracing \ xxxxxxx \ MaxFileSize = 3000000 – (REG_DWORD – 3 MB large – NAL and Debug Logging for growth with more than it is worth)

Important components to be linked to SQL for SQL logging, open the key:

HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ SMS \ Tracing \ Sqlenabled = 1 – (REG_DWORD)

Component of SQL and SCCM logs, including:

ciamgr.log – SMS_CI_ASSIGNMENT_MANAGER

Colleval.log – SMS_COLLECTION_EVALUATOR

compsumm.log – SMS_COMPONENT_STATUS_SUMMARIZER

Dataldr.log – SMS_INVENTORY_DATA_LOADER

ddm.log – SMS_DISCOVERY_DATA_MANAGER

Distmgr.log – SMS_DISTRIBUTION_MANAGER

Hman.log – SMS_HIERARCHY_MANAGER

objreplmgr.log – SMS_OBJECT_REPLICATION_MANAGER

offermgr.log – SMS_OFFER_MANAGER

Offersum.log – SMS_OFFER_STATUS_SUMMARIZER

policypv.log – SMS_POLICY_PROVIDER

sinvproc.log – SMS_SOFTWARE_INVENTORY_PROCESSOR

Sitestat.log – SMS_SITE_SYSTEM_STATUS_SUMMARIZER

smsdbmon.log – SMS_DATABASE_NOTIFICATION_MONITOR

statesys.log – SMS_STATE_SYSTEM

Statmgr.log – SMS_STATUS_MANAGER

swmproc.log – SMS_SOFTWARE_METERING_PROCESSOR

wcm.log – SMS_WSUS_CONFIGURATION_MANAGER

wsyncmgr.log – SMS_WSUS_SYNC_MANAGER

SMS Provider

HKEY_LOCAL_MACHINE \ Software \ Microsoft \ SMS \ Providers \ Logging Level = 1 – (REG_DWORD)

HKEY_LOCAL_MACHINE \ Software \ Microsoft \ SMS \ Providers \ SQL Cache Logging Level = 1 – (REG_DWORD)

HKEY_LOCAL_MACHINE \ Software \ Microsoft \ SMS \ Providers \ Log Size MB = 1 – (REG_DWORD)

SCCM logumuz with logging provider are as follows:

Smsprov.log

NAL logging:

Sometimes it may be enough, and NAL logging verbose logging information in the pop-up. Caution: NAL logging Log file too big for him, keeping detailed logs have benefits.

HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ NAL \ Logging

– DataType: REG_DWORD – Log To = 3

– DataType: REG_DWORD – Verbosity = 7

NAL logging, set the values:

NAL_LOG_VERBOSITY_LEVEL_1 = Errors

NAL_LOG_VERBOSITY_LEVEL_2 = Warnings

NAL_LOG_VERBOSITY_LEVEL_4 = Information

NAL_LOG_VERBOSITY_LEVEL_7 = Errors, Warnings, Information

SCCM loglarımız with NAL logging are as follows:

compsumm.log – SMS_COMPONENT_STATUS_SUMMARIZER

Distmgr.log – SMS_DISTRIBUTION_MANAGER

inboxmgr.log – SMS_INBOX_MANAGER

ntsvrdis.log – SMS_WINNT_SERVER_DISCOVERY_AGENT

sitecomp.log – SMS_SITE_COMPONENT_MANAGER

Sitestat.log – SMS_SITE_SYSTEM_STATUS_SUMMARIZER

smsexec.log – SMS_EXECUTIVE

IMPORTANT:Registry changes to work:

Stop the SMS_SITE_COMPONENT_MANAGER

Stop the SMS_EXECUTIVE

Start the SMS_EXECUTIVE

Start SMS_SITE_COMPONENT_MANAGER

SCCM Agent (Workstation):

CCM for the verbose logging:

For Administrator Key, “full rights” to provide the necessary – there is no default.

HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ CCM \ Logging \ @ GLOBAL

Set of the following values:

LogEnabled = 1

LogLevel = 0

LogMaxSize = 40000000

LogDirectory = c: \ windows \ system32 \ ccm \ logs (If you want to print the logs to a different location)

LogMaxHistory = 1 (Although the size of the logs filled with incense,> here is one: will be holding an old log. Example: Execmgr.log and will execmgr.lo_.
Verbose logging is not enough DebugLogging CCM:

This is necessary to create the reg KEYI:

HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ CCM \ Logging \ DebugLogging

– DataType: REG_SZ – Enabled = TRUE

WMI:

SCCM agent is based entirely WMI WMI is useful to turn verbose logging:

HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ WBEM \ CIMOM \ Logging = 0 – (REG_SZ – Disabled)

HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ WBEM \ CIMOM \ Logging = 1 – (REG_SZ – Error only)

HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ WBEM \ CIMOM \ Logging = 2 – (REG_SZ – Verbose)
HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ WBEM \ CIMOM \ Log File Max Size = 4000000 – (REG_DWORD – If you need to WMI 2)

IMPORTANT: To study the changes of registry and WMI:

Restart the Computer

Other important components are: WSUS + SCCM component:

Set HKLM \ SOFTWARE \ Microsoft \ SMS \ Components \ SMS_WSUS_SYNC_MANAGER

– DataType: REG_DWORD – LogLevel = 3
LOG_SUMMARY = 1;

LOG_DETAIL = 2; default

LOG_VERBOSE = 3;

LOG_DEBUG = 4;