- Details
- Written by: po3dno
- Category: Power Shell
- Hits: 997
$titles = ("Руководитель отдела","Руководитель управления","Руководитель сектора","Руководитель департамента")
# Рекурсивный поиск руководителя
function setmanager(){
param(
[string]$curdn = $null
)
- Details
- Written by: po3dno
- Category: Power Shell
- Hits: 932
param($a)
#if (test-connection $a){
Write-Host "Проверка компьютера " -ForeGroundColor Green $a
- Details
- Written by: po3dno
- Category: Power Shell
- Hits: 1150
This file has 7 sections
1. A few examples showing Process information, mem usage, cpu, handles etc.., and altering processes
2. A few examples of retrieving system information (system, memory, drives, hardware)
3. A few examples of listing Services
4. A few examples of altering the state of services
5. A few examples on how to get network information
6. For reference: A very basic listing of some DOS (cmd) commands, for file, directory, or task management.
7. A few wellknown scanning/tracing tools
- Details
- Written by: po3dno
- Category: Power Shell
- Hits: 1047
$list = Get-Content "distributiongroup.txt"
Foreach ($i in $list) {
$i
$grp = get-distributiongroup $i
$manage = $grp.managedby
$newuser = get-user USER
$newmanage = $manage + $newuser
Set-distributiongroup $grp -managedby $newmanage -bypasssecuritygroupmanagercheck
}
- Details
- Written by: po3dno
- Category: Power Shell
- Hits: 1395
_Reference54 - таблица с отделами из 1С
param($department)
$connection = New-Object System.Data.SqlClient.SqlConnection
$connection.ConnectionString = "Server=sql-1c8;database=1c82zp-db;uid=user1c8;pwd="
$connection.Open()
# Выбираем нужные данные
$sqlstr = "SELECT r54.[_Code], r54._Description, r54_t._Code, r54_t._Description FROM [1c82zp].[dbo].[_Reference54] r54
JOIN [1c82zp].[dbo].[_Reference54] r54_t on r54._ParentIDRRef = r54_t.[_IDRRef]
WHERE r54._Marked = 0
ORDER BY r54._Code";