---
title: "Powershell | FAQ UserLock"
description: "Frequently asked questions about using Powershell to manage UserLock."
locale: "en"
updated_at: "2025-11-03T08:08:56.682Z"
canonical: "https://www.isdecisions.com/en/userlock/docs/support/faq/powershell"
---

# Powershell

Learn how to manage UserLock through PowerShell commands and scripts.

## How to do a massive user sessions reset after a general power failure.

UserLock monitors in real time all user sessions on the network. It knows at any time all session status on protected computers to apply in real time the user access control policy you have defined. In some situations, it might be necessary to reset all sessions identified by UserLock as active (open or locked/disconnected). 
For example when a general power failure has occurred on the network. Without back-up power protection, machines will improperly shut down without notifying the session logoff to the UserLock server which will still consider sessions as open.

Of course several security and checking processes exist to correct this situation, as simply powering on concerned machines, or let the iterative task designed for this purpose identify and reset sessions. However, if this power failure involves the entire network, and therefore hundreds or thousands of machines, including UserLock server and its backup, then it may be useful to reset all user sessions.

This task can be performed using the following UserLock PowerShell command:

```powershell
Get-UserLockOrphanedInteractiveSession | Reset-UserLockSession -Force
```

This will reset all sessions that remain as active in your UserLock console.

More information on [UserLock PowerShell](/userlock/docs/build-with-userlock/powershell/userlock-powershell) available here.

## Why are the UserLock cmdlets not immediately available in a standard PowerShell console after installing UserLock?

This is because the "PSModulePath" environment variable is not updated yet. This environment variable will be updated if at least one of the following conditions is true:

- If the session is logged off then logged on again.
- If the "Explorer.exe" process is restarted.
- If you propagate environment variables to the system (see [https://web.archive.org/web/20091124062536/http://support.microsoft.com/kb/104011](https://web.archive.org/web/20091124062536/http://support.microsoft.com/kb/104011)).

Note that all UserLock cmdlets are available if you run "UserLockPowerShell" from the UserLock Console. 

More information on [UserLock PowerShell](/userlock/docs/build-with-userlock/powershell/userlock-powershell) available here.
