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

Home

Exchange photo export

Details
Written by: Senka
Category: Exchange Server
Created: 20 June 2013
Hits: 1460

# export photo

$a= Get-ADUser USERNAME -Properties thumbnailphoto

$a.thumbnailphoto | Set-Content c:\path\photo.jpg -Encoding byte

 

# have photo 

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

Get-ADUser -Filter {lastlogontimestamp -gt $date -and EmailAddress -like '*' -and thumbnailphoto -notlike '*'} -property * | Select Name,SamAccountName,EmailAddress,Department,@{Name="Disabled"; Exp={$_.useraccountcontrol -band 2}}| ?{$_.Disabled -eq 0} | Sort-Object name | export-csv nophoto.csv -Delimiter ";" -NoTypeInformation -Encoding Default

 

Get-ADUser -Filter {lastlogontimestamp -gt $date -and EmailAddress -like '*' -and thumbnailphoto -like '*'} -property * | Select Name,SamAccountName,EmailAddress,Department,@{Name="Disabled"; Exp={$_.useraccountcontrol -band 2}}| ?{$_.Disabled -eq 0} | Sort-Object name | export-csv photo.csv -Delimiter ";" -NoTypeInformation -Encoding Default

 

# import photo

param ($name)

$login="$name@domen"

Import-RecipientDataProperty -Identity $login -Picture -FileData ([Byte[]]$(Get-Content -Path "f:\tasks\exchange_photo\photo\$name.jpg" -Encoding Byte -ReadCount 0))

 

To remove a photo use the following:

Set-Mailbox USERNAME -removepicture

Удаление писем из почтовых ящиков

Details
Written by: Senka
Category: Exchange Server
Created: 20 June 2013
Hits: 1298

Смотрим результат, сколько удалит:

Search-Mailbox $mailbox -searchquery 'Получено:<18/05/2013' -EstimateResultOnly:$true

Удаляем:

Search-Mailbox $mailbox -searchquery 'Получено:<18/05/2013' -DeleteContent

Exchange права редактирования групп рассылки

Details
Written by: Senka
Category: Exchange Server
Created: 18 June 2013
Hits: 1343

$list = Get-Content "dg.txt"

Foreach ($i in $list) {
$i
$grp = get-distributiongroup $i
$manage = $grp.managedby
$newuser = get-user k.tsvetkova
$newmanage = $manage + $newuser
Set-distributiongroup $grp -managedby $newmanage -bypasssecuritygroupmanagercheck
}

Вид файла CSV:

#user,#groupname 


#$list = import-csv AddDistributionGroupOwnerList.csv

#Foreach ($i in $list) {
# $grp = get-distributiongroup $i.groupname
# $manage = $grp.managedby
# $newuser = get-user $i.user
# $newmanage = $manage+$newuser
# Set-distributiongroup $grp -managedby $newmanage -bypasssecuritygroupmanagercheck
#}

Отправка сообщения пользователю при добавлении в доменную группу

Details
Written by: Senka
Category: Power Shell
Created: 17 June 2013
Hits: 1308

Получаем список членов группы, сравниваем с файлом, где хранится старая информация о составе группе. Если появился новый сотрудник, то отправляем ему письмо.

Read more …

Настройки в ini файле на C#W

Details
Written by: Senka
Category: C#
Created: 11 June 2013
Hits: 1658

  

            IniFile ini = new IniFile("./config.ini");

            if (ini.IniReadValue("Settings", "Server") != "")

                servername = ini.IniReadValue("Settings", "Server");

 

            IniFile ini = new IniFile("config.ini");

            ini.IniWriteValue("Settings", "Server", servername);

 

Read more …

  1. Открываем файл на C#
  2. Читаем XLSL на C#
  3. POST запрос на C#
  4. Пароль никогда не устаревает

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 29 of 32

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

Login Form

  • Forgot your password?
  • Forgot your username?

Statistics

  • Users 2
  • Articles 177
  • Articles View Hits 173494