Home
- Details
- Written by: po3dno
- Category: C#
- Hits: 940
string pc = System.Environment.MachineName;
if (args.Count() == 1)
pc = args[0];
// Ограничение на поле class = 33 символа
string[] List = new string[] {
"Win32_BaseBoard",
"Win32_BIOS",
"Win32_ComputerSystem",
//"Win32_Environment",
"Win32_LogicalDisk",
"Win32_NetworkAdapter",
"Win32_OperatingSystem",
"Win32_NetworkAdapterConfiguration"
};
- Details
- Written by: po3dno
- Category: Exchange Server
- Hits: 926
1. Удаление автономной адресной книги
Get-OfflineAddressBook | Remove-OfflineAddressBook -confirm:$false -force
2. Удаление арбитражных ящиков
Get-Mailbox -Arbitration | Disable-Mailbox -Arbitration –DisableLastArbitrationMailboxAllowed -confirm:$false
3. Отключение всех ящиков
Get-Mailbox -archive | Disable-Mailbox -confirm:$false
Get-Mailbox -monitoring | Disable-Mailbox -confirm:$false
Get-Mailbox | Disable-Mailbox -confirm:$false
Get-Mailbox -AuditLog | Disable-Mailbox -confirm:$false
4. Удаление базы данных
Get-MailboxDatabase | Remove-MailboxDatabase -confirm:$false
- Details
- Written by: po3dno
- Category: Exchange Server
- Hits: 949
To perform this task, we'll first set two variables to define the source and target servers:
$OldServer = "OldServer"
$NewServer = "NewServer"
Then, we'll retrieve the list of non-default Receive Connectors from the source server into the variable$ReceiveConnectors:
[array]$ReceiveConnectors = Get-ReceiveConnector -Server $OldServer | Where {$_.Name -notlike "Default $($OldServer)" -and $_.Name -notlike "Client $($OldServer)"}
- Details
- Written by: po3dno
- Category: Other
- Hits: 946
gc computers.txt | %{$c = $_; ..\PsExec.exe -s -d -n 5 \\$c cmd /c 'Uninstall_IE10.cmd'}
Содержимое Uninstall_IE10.cmd:
FORFILES /P %WINDIR%\servicing\Packages /M Microsoft-Windows-InternetExplorer-*10.*.mum /c "cmd /c echo Uninstalling package @fname && start /w pkgmgr /up:@fname /quiet /norestart
Содержимое Uninstall_IE11.cmd:
FORFILES /P %WINDIR%\servicing\Packages /M Microsoft-Windows-InternetExplorer-*11.*.mum /c "cmd /c echo Uninstalling package @fname && start /w pkgmgr /up:@fname /quiet /norestart
- Details
- Written by: po3dno
- Category: Power Shell
- Hits: 963
Get-WmiObject -class MSFC_FibrePortHBAAttributes -namespace "root\WMI" | Select -Expandproperty Attributes | % { ($_.PortWWN | % {"{0:x2}" -f $_}) -join ":"}