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

Home

Сравниваем пользователей на вхождение в две группы

Details
Written by: Senka
Category: Power Shell
Created: 16 October 2013
Hits: 1441

Get-ADGroupMember customers | %{$u1= $_; $gr = (get-adgroup call-operators).DistinguishedName; $u = get-aduser -filter {samaccountname -eq $u1.samaccountname -and (MemberOf -recursivematch $gr)} -property memberof; if (($u | measure).count -eq 0){write-host $u1.name -ForegroundColor green}}

GPO Links

Details
Written by: Senka
Category: Power Shell
Created: 25 September 2013
Hits: 1447
Import-Modulet GroupPolicy
Function Get-AllGPO { Get-GPOReport -all -ReportType xml | %{ ([xml]$_).gpo | select name,@{n="SOMName";e={$_.LinksTo | % {$_.SOMName}}},@{n="SOMPath";e={$_.LinksTo | %{$_.SOMPath}}} } } #Get Gpo with name Turn* and display what OU is linked. Get-AllGPO | ? {$_.Name -like "*Turn*"} | ft

Mailbox Quotes

Details
Written by: Senka
Category: Exchange Server
Created: 25 September 2013
Hits: 1356

Get-Mailbox -ResultSize Unlimited | select displayname,database,{$_.ProhibitSendQuota.Value.ToMB()},{$_.ProhibitSendReceiveQuota.Value.ToMB()},{$_.IssueWarningQuota.Value.ToMB()} | Export-Csv mb.csv -Delimiter ";" -encoding Default -notypeinformation

Список процессов с владельцем

Details
Written by: Senka
Category: Power Shell
Created: 20 September 2013
Hits: 1342

Get-WmiObject -Namespace "root\cimv2" -Class Win32_Process -ComputerName . | select name,@{name="owner";exp={$_.getowner().user}}

Находим всех пользователей в списке групп

Details
Written by: Senka
Category: Power Shell
Created: 27 August 2013
Hits: 1391

import-module activedirectory

function ug {
param([string]$gr)
 Get-ADGroupMember "$gr" |? {$_.objectclass -eq "user"} | sort samaccountname | %{$a = $_.samaccountname; echo "$gr;$a;"}
Get-ADGroupMember "$gr" |? {$_.objectclass -eq "group"} | sort samaccountname | %{$a = $_.samaccountname; ug $a}
}

Get-content ./groups.txt | %{
ug "$_"
} > ad_groups.txt

  1. Проверка времени создания файла и отправка себе на почту
  2. Move Group Members to OU
  3. Автоматическая загрузка и обновление фотографий пользователей в Exchange
  4. PowerShell can speak

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:  9

Docker Article Count:  3

pg Article Count:  2

Page 27 of 32

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

Login Form

  • Forgot your password?
  • Forgot your username?

Statistics

  • Users 2
  • Articles 177
  • Articles View Hits 173494