Posts

Showing posts from October, 2018

Get computer last logon date PowerShell

Image
In this post, I describe how to get the last logon date for computers in Active Directory using PowerShell. Get last logon date for a single computer To retrieve the last logon date for a single computer, specified by name, use the following PowerShell cmdlet: Get-ADComputer -Identity %COMPUTERNAME% -Properties LastLogonDate | FT Name, LastLogonDate Get last logon date for all computers To retrieve the last logon date for all computers in a domain, use the following PowerShell cmdlet: Get-ADComputer -Filter * -Properties LastLogonDate  | FT Name, LastLogonDate Related Post -  Test WMI Query with PowerShell

The WinRM client cannot process the request. The authentication mechanism requested by the client is not supported by the server or unencrypted traffic is disabled in the service configuration.

Image
This post describes how to fix the error: The WinRM client cannot process the request. The authentication mechanism requested by the client is not supported by the server or unencrypted traffic is disabled in the service configuration. Verify the unencrypted traffic setting in the service configuration or specify one of the authentication mechanisms supported by the server. Cause This error can occur when you try to connect to a machine using PowerShell Remoting and the authentication mechanism specified is disabled in the WinRM configuration of that machine. You can check the WinRM authentication settings by running the following command on the machine you are trying to connect to: winrm get winrm/config/service/auth Resolution To resolve the issue, enable the authentication mechanism you are trying to connect with. In my case, the 'Dis

PackageManagement\Install-Package : No match was found for the specified search criteria and module name

Image
This post describes how to fix the error PackageManagement\Install-Package : No match was found for the specified search criteria and module name 'AzureRM', 'nuget', 'azuread', 'msonline', 'vmware.powercli', sqlserver' and more. Cause This error can occur when trying to install packages/modules if the account being used does not have any repositories configured.  You can check this by running: Get-PSRepository Note: I had to install PowerShell v5 from Windows Management Framework 5 (WMF 5) for Get-PSRepository to work.  Please read this post if PowerShell does not open on Windows Server 2008 R2  after installing WMF 5. Resolution If the PowerShell Gallery (PSGallery) repository is not installed, either logon as another user who has this repository installed, or restore it by running (ensure you have an internet connection): Register-PSRepository -Default If this fails, please see my other post  No match was f

Feedburner page for my blog

I recently discovered this page which contains the syndicated content for this blog powered by Feedburner  http://feeds2.feedburner.com/HowardSimpsonsBlog?format=XML . Just thought I'd post it here for those that are interested.

The client cannot connect to the destination specified in the request. Verify that the service on the destination is running and is accepting requests.

Image
This post describes how to fix the error: The client cannot connect to the destination specified in the request. Verify that the service on the desination is running and is accepting requests. Consult the logs and documentation for the WS-Management service running on the destination, most commonly IIS or WinRM. If the destination is the WinRM service, run the following command on the destination to analyze and configure the WinRM service: "winrm quickconfig". For more information, see the about_Remote_Troubleshooting Help topic. Cause This error can occur when you try to connect to a machine using PowerShell remoting.  There are a few potential causes: - PowerShell remoting is not enabled. - The Windows Remote Management (WS-Management) service is stopped. - The WinRM firewall exception is not enabled - The LocalAccountTokenFilterPolicy has not been configured to grant administrative rights remotely to local users Resolution - Open PowerShell as an admin