- The server was running in VMWare environment.
- The server was rebooting again and again.
- After looking into the event viewer for the reboot cause found the error "The kernel power manager has initiated a shutdown transition. Shutdown Reason: Kernel API"
- The Dism /online set-edition:serverstand.... command took more than 30 minutes to complete
- The server rebooted more than one time after running the DISM command.
- the cleaning up process took few hours to complete
Tuesday, 20 October 2020
Solved: Unable to activate Windows server 2016 though GUI. getting error "This Edition Cannot Be Upgraded"
Saturday, 17 October 2020
Resolved: [{LED=451 4.4.395 Target host responded with error. -> 421 4.4.1 Connection timed
Mails stuck in queue, with the following error in queue.
[{LED=451 4.4.395 Target host responded with error. -> 421 4.4.1 Connection timed
the solution was:
Enable-ExchangeCertificate -ThumbPrint "thumbprint of the required new certificate" -services SMTP
Detail:
After updating SSL certificate in Exchange Server 2016 environment, including mailbox servers and edge servers, the mails were getting stuck in queue with the error "[{LED=451 4.4.395 Target host responded with error. -> 421 4.4.1 Connection timed"
after looking into it further, it was found that the new certificate was not enabled for the SMTP service.
So by enabling the new Certificate for the SMTP service, the issue was resolved.
Enable-ExchangeCertificate -ThumbPrint "thumbprint of the required new certificate" -services SMTP
Thursday, 30 July 2020
How to import an SSL certificate in the personal store on windows machine
certutil -user -p pfxpassword -importPFX pathofCert\abc.pfx
To import an SSL certificate in the personal store for computer account on windows machine
certutil -p pfxpassword -importPFX pathofCert\abc.pfx
P.S: pfxpassword: while generating/exporting the pfx certificate from the CA server or any other machine one which the certificate is already there, you would have given the pfxpassword.
so keep that password noted as you will need it while importing on any machine with the above command or through console.
Saturday, 18 July 2020
Resolved: "Remove-ADUser : The directory service can perform the requested operation only on a leaf object"
Friday, 10 July 2020
How to search and delete email from users mailboxes in office 365
$Search=New-ComplianceSearch -Name "RemovePhishingMessage" -ExchangeLocation All -ContentMatchQuery '(Received:4/13/2020..4/14/2020) AND (Subject:"Subject of the email")'
Now you must Start the complainceSearch with the following command
Start-ComplianceSearch -Identity $Search.Identity
You can confirm the status of the complianceSearch with the following command
PS C:\Users\Nawaz> Get-ComplianceSearch ""RemovePhishingMessage
It will show the status like, not started, inprogress, completed.
If completed, you can run the following command which will show you the number of items found through the compliance search, as mentioned in our case is 32.
PS C:\Users\Nawaz> get-ComplianceSearch "RemovePhishingMessage" | fl
RunspaceId : 4bef9a2a-4a98-46a4-8e57-f593a43b1
Language :
StatusMailRecipients : {}
LogLevel : Suppressed
IncludeUnindexedItems : True
ContentMatchQuery : (Received:07/09/2020..07/10/2020) AND (Subject:" Notice Password")
SearchType : EstimateSearch
HoldNames : {}
SearchNames : {}
RefinerNames : {}
Region :
Refiners :
Items : 32
Size : 2911505
UnindexedItems : 28319
UnindexedSize : 79987919058
SuccessResults : {Location: abit@mydomain.com, Item count: 7, Total size: 608342,
Location: MUI@mydomain.com, Item count: 4, Total size: 324402,
Location: Mash@mydomain.com, Item count: 3, Total size: 316067,
Location: Irfa@mydomain.com, Item count: 3, Total size: 299224,
Location: Moh@mydomain.com, Item count: 3, Total size: 298679,
Location: athed@mydomain.com, Item count: 3, Total size: 285691,
Location: Nawaz@mydomain.com, Item count: 3, Total size: 280505,
Location: Shahzad.Khurram@mydomain.com, Item count: 6, Total size: 259699,
Run the command below if you want to soft delete the emails.
New-ComplianceSearchAction -SearchName "RemovePhishingMessage" -Purge -PurgeType SoftDelete
New-ComplianceSearchAction -SearchName "RemovePhishingMessage" -Purge -PurgeType HardDelete
Thursday, 11 June 2020
How to set Database Activation Preference number for a Database in Exchange server 2016
At one point i had to play with the DAG failover/switchover, in which i found that every time i activate any of the DBs on any desired server, after some time (1-2 hours) the DBs automatically move/activate back on the first server in the PR site.
After looking into it more i noticed that the "ActivationPreference" value on that server was lowest, set to "1".
So as per the default behavior of the DAG, every time if there is any issue in the DAG/database copies, the DAG will activate the DB on the server which has the most healthy copy. If all the servers have the healthy copies then the copy on the server with the lowest "ActivationPreference" number , i.e "1", will be activated.
So now i have to change the "ActivationPreference" number of all the 30 DBs but you know from the ECP it was a lengthy task so i followed the following steps in the Exchange management shell and performed it very easily and in a very short time.
First i had to check the current status (ActivationPreference value) of each of the DB with the following command.
Get-MailboxDatabase service1603 | fl servers, ActivationPreference
Then i used the following command to set the "ActivationPreference" value as per my requirement.
Set-MailboxDatabaseCopy -identity ‘service1603\MBS03’ -ActivationPreference 1
To check/verify the changes use the following command again but it took some time to show the updated value but in ECP the update value was appearing.
Get-MailboxDatabase service1603 | fl servers, ActivationPreference
so you should give it some time or check in ECP the updated values.
Tuesday, 9 June 2020
How to export last password reset date of Azure AD/office 365 users through powershell
1)
login to Azure AD
$credential = Get-Credential
(once prompt for credentials, use your username/password i.e nawaz@mycompany.com/password)
Then you may use one of the following command to connect Azure AD.
2)
Connect-AzureAD -Credential $credential
OR
Connect-MsolService -Credential $credential
Now you should be connected with Azure AD, to confirm you may use type the first few characters of any Azure AD command and press Tab key, if the command showing any suggested command then it means you are connect.
3)
Get the required detail of one user and then get/use the same command for all users.
so lets use
PS C:\Windows\system32> Get-MsolUser -UserPrincipalName nawaz@mycommany.com | select displayname, lastpasswordchangetimestamp
DisplayName LastPasswordChangeTimestamp
----------- ---------------------------
Nawaz Khan System engineer 2/26/2020 7:59:58 AM
Now that we got the desired details for a single user, so we can use the same command, just replacing the -UserPrincipalName with -all switch and exporting the output to a CSV.
Get-MsolUser -All | select DisplayName,LastPasswordChangeTimeStamp >c:\path\LastPasswordChangeDate.csv
Now you may have to wait for the command to complete, it may get time to complete, as per your number of users in Azure.