• Home
  • PS
  • C#
  • Perl
  • MSSQL
  • MariaDB
  • Linux
  • Docker
  • MacOS
  • PG
  • Exchange Server
  • Windows
  • Other

Home

Формируем списки устаревших пользователей для руководителей

Details
Written by: Senka
Category: Power Shell
Created: 11 June 2013
Hits: 1624

 

Import-Module ActiveDirectory

$date = (Get-Date).AddDays(-90)

$Managers = Get-ADUser -Filter {((lastlogontimestamp -lt $date) -or (lastlogontimestamp -notlike '*')) -and (whencreated -lt $date) -and ((PasswordLastSet -lt $date) -or (PasswordLastSet -notlike '*')) -and (PasswordNeverExpires -eq 'False')} -property * | Select SamAccountName,Name,CanonicalName, EmailAddress,PasswordLastSet,WhenCreated,PasswordExpired,PasswordNeverExpires, ProfilePath,Department,Title,Manager,@{Name="Disabled"; Exp={$_.useraccountcontrol -band 2}} |?{($_.Disabled -eq 0) -and ($_.PasswordExpired -eq 'True')} | select Manager | sort-object Manager -Unique

 

Read more …

Subcategories

Power Shell Article Count:  53

C# Article Count:  10

Perl Article Count:  1

Exchange Server Article Count:  15

Other Article Count:  24

MSSQL Article Count:  17

Windows Article Count:  25

MariaDB Article Count:  3

Linux Article Count:  7

Docker Article Count:  2

pg Article Count:  1

Page 32 of 32

  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32

Login Form

  • Forgot your password?
  • Forgot your username?

Statistics

  • Users 2
  • Articles 164
  • Articles View Hits 148993