Good Contents Are Everywhere, But Here, We Deliver The Best of The Best.Please Hold on!
Data is Loading...
Your address will show here +12 34 56 78
PowerShell, Server, Windows
You can do everything with PowerShell, yes as well locking your workstation with one simple function call. The function uses the API by importing the user32.dll and is being invoked to lock the workstation. Thanks to Mike Pfeiffer from TechNet for this simple but useful script. The fine thing is, it works on a local or remote session.

 

0

PowerShell, Server, Windows
As published in my Technet Gallery Script Center here, you can get current timezones remotely via PowerShell with Get-Timezones. Get-Timezones is using WMI to communicate with your servers.

This will give you following output:



With Set-Timezone you can set timezones remotely. If you need to disable automatic daylight saving time you can add the additional parameter DSTOff.

This will give you following output:



To get a full list of all timezone IDs type “tzutil /l” and you will get following list:



 

1

Cluster, Server, Windows
The purpose of this article is to show how to adjust Windows Failover Cluster “Response to resource failure” policy.

If a Cluster Core Resource like File Share Witness or Disk Quorum is in a failing state and offline, the cluster runs into jeopardy and will fail once the active node gets rebooted as no vote can be set to the quorum. To avoid this you should decrease the value of time your cluster core resource attempts to restart. The lower the value the higher the amount of retries your resource has to restart itself.
To increase restart attempts for the Cluster Core Resource you need to adjust the “Response to resource failure” policy from one hour to 15 minutes.


So with a given period for restarts of 15 minutes, maximum restarts in the specified period of 1 and “If all the restart attempts fail, begin restarting again after the specified period of period” of 15 minutes. The resource will try restarting itself again every 15 minutes instead every hour until it’s brought back up online.
0

Server, Windows
If you’re searching for Windows Server Licensing and Activation Details of your Windows machine you can use following statements

which will give you following output


If you’re searching for some other details like your client machine ID (CMID) you can use following statement

which will give you following output


Both commands work for KMS and Non-KMS clients. It’s always good to have an opportunity to retrieve details like

  • License Status
  • Volume Activation Expiration
  • Client Machine ID (CMID)
  • KMS machine IP address
  • KMS machine extended PID
  • Activation interval
  • Renewal interval
  • Activation ID
  • Application ID
  • Extended PID
  • Produkt Key Channel Volume
  • Installation ID
  • Volume activation expiration
  • Remaining Windows rearm count
  • Reaming SKU rearm count
0

Hotfix, Patching, PowerShell, Server, Windows
I just wanted to share you a tiny snippet if you’re looking for a simple PowerShell liner to simply get a KB Hotfix installed. It also verifies if the KB is installed already.
Okay this is a small one for you guys but trust me I will wrap it for you into a big function if you want to use it with more than one server or even Credentials.

 

0

Server, Windows
Open PowerShell or Commmand Shell, enter following

This will open your device manager with the ability to show hidden devices. Click on View and select “Show hidden devices”.



Select your hidden device you need to remove, right click and select uninstall. That’s it!



In case you need to remove multiple orphan / hidden / ghosted devices like disks on Windows Failover Cluster Nodes you can use Ghostbuster for that. See my other article about Ghostbuster as well.
0

PowerShell, Server, Windows
Every System Administrator comes into a situation where you want to see who and how many users were logged on to your servers either via Remote Desktop or via script. This little function evaluates the System log with the help of Get-EventLog and delivers you the latest logon and logoff events for every user. 

I’ve left you the Invoke-Command commented if you want to use PowerShell Remoting (WinRM).


Please keep in mind, it evaluates every event, this means even if a user was doing actions remotely using a powershell script or just logged on, it will be displayed as well. If you want to distinguish between script logons you can easily have a look at the logon and logoff times. If a user account was only logged for some seconds … then this is an indicator for a remote script logon.

The script will give you following output:


While using following command you can also query this function to more than just one server:

 

 

0

PREVIOUS POSTSPage 1 of 2NO NEW POSTS