随笔分类 - Powershell
摘要:Get-POPSettings-110 Get-IMAPSettings-143 Exchange Network Port References Exchange Server 2000 http://support.microsoft.com/kb/278339/ Exchange Server
阅读全文
摘要:发送邮件的三种方式: 1、VBS 执行vbs脚本文件的程序为: system32文件下的 2、Telnet 使用Telnet发送邮件 SMTP(SimpleMailTransferProtocol)即简单邮件传输协议,它是一组用于由源地址到目的地址传送邮件的规则,由它来控制信件的中转方式。SMTP协
阅读全文
摘要:使用方法: Get-CASActiveUsers -server server1,server2 Get-CASMailbox | Get-CASActiveUsers $RPC = Get-Counter "\MSExchange RpcClientAccess\User Count" -Comp
阅读全文
摘要:一:截取一个字符串的尾部,替代字符串中的特定字符或替代字符串中特定位置的特定字符 $a="W.endy.chen.SHAO" $b=$a.Substring(0,$a.Length-5) -replace "\.","_" $c=$a.Substring(0,$a.Length-5).Replace
阅读全文
摘要:知识点: 1、获取路径中的文件夹:Get-ChildItem $startFolder | Where-Object {$_.PSIsContainer -eq $True} | Sort-Object 2、获取文件夹的总大小Get-ChildItem $i.FullName -recurse | Measure-Object -property length -sum 3、 正则表达式:$DB...
阅读全文
摘要:使用Where-Object也可以根据其它属性来过滤。 Dir | Where-Object { $_.CreationTime -gt [datetime]::Parse("May 12, 2007") } Dir | Where-Object { $_.CreationTime -gt (Get
阅读全文
摘要:从文件中找出关键字 $all=$members | findstr /i "GroupWendy Groupgaga" 可以放在一个条件中 $w=$members | findstr /i "GroupWendy" #筛选群组,用findstr /i为忽略大小写参数 findstr /i "^Gro
阅读全文
摘要:File System Rights
阅读全文
摘要:方法一: Get-Content "D:\PowershellScripts\Test\ErrorMailNotice.ps1" | Invoke-Expression 方法二: $script = "D:\PowershellScripts\Test\ErrorMailNotice.ps1" .$
阅读全文
摘要:暂停Windows PowerShell 10秒: Start-Sleep –s 10 暂停脚本10秒(10,000毫秒) Start-Sleep –m 10000 语法 Start-Sleep [-seconds] <int> [<CommonParameters>] Start-Sleep -m
阅读全文
摘要:Powershell Exchange Message Per Day Sent and Reveive
阅读全文
摘要:一: 结合active directory获取本地群组成员信息(包含本地用户和域用户,及域用户的情况 二、#Function Get-LocalGroupMembership Function Get-LocalGroupMembership { <# .Synopsis Get the local
阅读全文
摘要:Function Get-registerkey 引用前一篇文章中的代码的一部分做修改,从注册表中查询server的susid Function Get-registerkey { <# #> [CmdletBinding()] param( [Parameter(Position=0,ValueF
阅读全文
摘要:Function Get-PendingReboot { <# .SYNOPSIS Gets the pending reboot status on a local or remote computer. .DESCRIPTION This function will query the regi
阅读全文
摘要:代码原文地址: https://gallery.technet.microsoft.com/scriptcenter/Get-TimeZone-PowerShell-4f1a34e6
阅读全文
摘要:Server up time
阅读全文
摘要:在Windows PowerShell里New-TimeSpan cmdlet提供了一种方法做日期算法。 计算时间间隔: 这个命令告诉你今天的日期与2006年除夕之间的天数: New-TimeSpan $(Get-Date) $(Get-Date –month 12 -day 31 -year 20
阅读全文
摘要:– Create and initialize the object $objExcel = New-Object -ComObject Excel.Application – Query the version of the Office installed $objExcel.version –
阅读全文
摘要:If ((Get-PSSnapin | where {$_.Name -match "Microsoft.Exchange.Management.PowerShell.E2010"}) -eq $null) { Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 . $env:ExchangeInstallPath\...
阅读全文

浙公网安备 33010602011771号