Search This Blog

Tuesday, February 9, 2021

PowerShell Script to Find Last Logon Date Information from Computer with Windows 7 Operating System

Description:

You need to get a list of all Windows 7 computer with Last Logon Date information in your domain.

Resolution:

Run the following PowerShell command:

Get-ADComputer -Filter * -Properties OperatingSystem, LastLogonDate | where {$_.OperatingSystem -match "Windows 7 Professional"} | select Name, OperatingSystem, LastLogonDate | sort LastLogonDate –unique | Export-Csv c:\workcomputers.csv

Error when Upgrading Azure AD Connect version

Description:

When you upgrade Azure AD Connect from a previous version, you might encountered the following error: "Upgrade cannot proceed because the Azure Active Directory connector (b891884f-051e-4a83-95af-2544101c9083) is missing.

Error

Resolution:

Make sure the PowerShell Execution Policy is set to unrestricted. You can check by running the following command at PowerShell:

Get-ExecutionPolicy

To change the execution Policy to unrestricted, run the following PowerShell command:

Set-ExecutionPolicy Unrestricted

Type Y when asked.

Re-Run the upgrade process again.

Tuesday, June 27, 2017

PowerShell command - GetWmiObject


> To get the remote computer name from IP Address:
Get-WmiObject Win32_ComputerSystem -ComputerName remotecomputerIPaddress | Select Name
> To get the computer description from a machine remotely:
Get-WmiObject Win32_OperatingSystem -ComputerName remotecomputernameorIPaddress | Select Description
> To get the currently logged on user from a machine remotely:
Get-WmiObject Win32_ComputerSystem -ComputerName remotecomputernameorIPaddress | Select UserName

Monday, June 26, 2017

Blue Screen after modifying Windows registry - Recovery

Description
You changed certain value on your Windows machine's registry (HKLM). After a restart, the machine cannot start properly again. Windows never reached the normal logon page.
You want to revert the changes back to previous condition.


Resolution
Use a CD/DVD/ISO to boot to the Recovery Environment. Follow the wizard until you can open the command prompt. At the command prompt, type regedit.
In the registry editor, highlight HKEY_LOCAL_MACHINE, and then go to File and select Load Hive. Select the file from other drives. It could be in E:\(or F:\)Windows\System32\Config, and will be called just SOFTWARE or SYSTEM. Type any name when the wizard prompt for the hive name.
Go to the registry location where you performed the last changes. Revert the value back to previous working condition.
To unload  the Hive, Highlight that hive name under HKEY_LOCAL_MACHINE, and go to File and select Unload Hive.
Restart the machine normally.




 

Repadmin Error 1722

Description
You are doing daily check of Active Directory replication on your Admin's machine using repadmin /replsum command.
You saw there are error 1722 at the bottom of the result.
You have checked that all the necessary port for Active Directory are open. You also verify using PortQry tool.
You try to perform WMI query from Admin's machine to the suspected DC but failed.
You logon to the suspected DC and all incoming replication are ok.


Resolution
Run the WMI query and monitor the network. Most probably there are some RPC traffic being dropped somewhere in the network. On Windows 2008 and above, please check for traffic running on RPC dynamic port (49152 - 65535).

Search Google