Quantcast
Channel: Exchange Server 2010 forum
Viewing all articles
Browse latest Browse all 8820

batch script through powershell to see last logon, last password change etc for an AD user

$
0
0

Please note that I am only a servicedesk person - I have no elite skills, but I am trying to make this script to check the user info.
I just tried with the knowledge I have, and obviously I am doing it wrong, but I need to know how. This is how my password.bat-file looks like now:

@echo off
set /P username="Enter username:"
powershell import-module activedirectory Get-ADUser -identity "%username%" -Properties PasswordLastSet,PasswordExpired

Pause

But this only gives error which I can't make out. It seems I can't use all of these commands at once. I guess I should use | somewhere? But not sure..


Kthxbai


Viewing all articles
Browse latest Browse all 8820

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>