Powershell管理系列(三十六)PowerShell操作之统计域内计算机硬件资产

-----提供AD\Exchange\Lync\Sharepoint\CRM\SC\O365等微软产品实施及外包,QQ:185426445.电话18666943750

客户端需设置防火墙,[注意要先设置管理模版防火墙设置,否则将会覆盖默认组策略的高级防火墙安全设置]

1、允许远程管理,设置如下,启用windows防火墙:允许入站管理程序

参考链接:http://908174.blog.51cto.com/898174/1175525

2、 允许远程桌面

3、允许ping,打开组策略,高级安全防火墙设置,入站规则

4、选择ICMPv4和ICMPv6

5、点击下一步完成

6、允许Powershell远程管理

具体设置参考链接:

http://yuntcloud.blog.51cto.com/1173839/1790701

脚本如下:

#统计ip、MAC地址、计算机名、登录用户、计算机配置、主机序列号、硬盘序列号、计算机型号、windows及SP的版本、C盘可用空间
#防火墙开启windows远程管理、windows防火墙允许入站远程管理
#编写:周平 QQ:185426445 联系方式:18666943750 欢迎技术交流和提出修改意见
Import-Module activedirectory                                                   
#导入其中的AD 模块
$computeraccount=Get-ADComputer -Filter * -Properties * |?{($_.OperatingSystem -ne $null) -and ($_.enabled) -and ($_.IPv4Address -ne $null) }|select -ExpandProperty name         
#获取当前AD 计算机中的所有机器NETBIOS名称,排除禁用的,无操作系统类型、没有IP的
[email protected]()                                                            
#定义所有计算机的初始空值
foreach ($currentcomputename in $computeraccount)                               
#根据计算机对象进行轮询
      { 
        if (Test-NetConnection $currentcomputename|select -ExpandProperty PingSucceeded) `
        #测试计算机是否可以ping通,如果可以ping通,则继续执行
        {
        $currentcomputename+"正测试IP连通性..."   
        $currentname= Get-ADComputer -Identity $currentcomputename|select -ExpandProperty name         
        #获取机器的NETBIOS名称       
        $currentuser=(Get-WmiObject Win32_Process -Filter ‘Name="explorer.exe"‘ -ComputerName $currentcomputename).getOwner() | Select -ExpandProperty User
        #获取机器的当前登录用户 
        $currentoperatingsystem= Get-ADComputer -Identity $currentcomputename -Properties * |select -ExpandProperty OperatingSystem          
        #获取机器的操作系统版本  
        $currentoperatingsystemsp= Get-ADComputer -Identity $currentcomputename -Properties * |select -ExpandProperty OperatingSystemServicePack          
        #获取机器的操作系统SP版本                                   
        $currentclass= Get-WmiObject -class Win32_BIOS -computername $currentcomputename -namespace "root\cimv2" |select -ExpandProperty SerialNumber        
        #通过获取WMI中的bios 类获取到机器相应的序列号,存放在BIOS的SN
        $currentIP=Get-WmiObject -class Win32_NetworkAdapterConfiguration -computername $currentcomputename -Filter IPEnabled=true |select -ExpandProperty IPAddress -First 1 |?{$_ -notlike "*:*" -and $_ -notlike "169*"}   
        #通过获取WMI中的IPV4地址      
        $currentMAC= Get-WmiObject -class Win32_NetworkAdapterConfiguration -computername $currentcomputename -Filter IPEnabled=true -Property * |?{$_.IPAddress -match $currentIP} |select -ExpandProperty macaddress -First 1 
        #通过获取WMI中的MAC地址 
        $currentdiskSN=  Get-WmiObject -Class Win32_DiskDrive -computername $currentcomputename |select -First 1 -ExpandProperty Model        
        #通过获取WMI中的硬盘BIOS序列号
        $currentpcmodel=  Get-WmiObject -Class Win32_ComputerSystem -computername $currentcomputename -Property * |select -ExpandProperty Model        
        #通过获取WMI中的计算机类型       
        $currentmemory=  (Get-WmiObject -Class Win32_ComputerSystem -computername $currentcomputename -Property * |select -ExpandProperty TotalPhysicalMemory)/1gb -as [int]       
        #通过获取WMI中的计算机内存   
        $currentharddisk=  (Get-WmiObject -Class Win32_DiskDrive -computername $currentcomputename|select -First 1 -ExpandProperty size)/1gb  -as [int]      
        #通过获取WMI中的硬盘大小   
        $currentdiskcfreesize=  ((Get-WMIObject Win32_LogicalDisk -ComputerName $currentcomputename | ? { $_.deviceid -match "c" }).freespace)/1GB -as [int]      
        #通过获取WMI中的C盘可用空间大小                       
        $computerproperty=New-Object  psobject                                                                                                               
        #定义一个新PS 对象
        $computerproperty|  Add-Member -MemberType NoteProperty -Name "计算机名" -Value  $currentname                                                        
        #为新的对象定义计算机名称属性
        $computerproperty|  Add-Member -MemberType NoteProperty -Name "登录用户名" -Value  $currentuser                                                        
        #为新的对象定义计算机当前登录用户名属性
        $computerproperty|  Add-Member -MemberType NoteProperty -Name "主机序列号" -Value $currentclass                                                          
        #为计算机对象定义序列号属性   
        $computerproperty|  Add-Member -MemberType NoteProperty -Name "IP地址" -Value $currentip                                                          
        #为计算机对象定义IP地址属性  
        $computerproperty|  Add-Member -MemberType NoteProperty -Name "MAC地址" -Value $currentMAC                                                          
        #为计算机对象定义MAC地址属性 
        $computerproperty|  Add-Member -MemberType NoteProperty -Name "硬盘序列号" -Value $currentdisksn                                                          
        #为计算机对象定义硬盘序列号属性  
        $computerproperty|  Add-Member -MemberType NoteProperty -Name "操作系统版本" -Value $currentoperatingsystem                                                          
        #为计算机对象定义操作系统版本   
        $computerproperty|  Add-Member -MemberType NoteProperty -Name "操作系统SP版本" -Value $currentoperatingsystemsp                                                          
        #为计算机对象定义操作系统SP版本   
        $computerproperty|  Add-Member -MemberType NoteProperty -Name "计算机类型" -Value $currentpcmodel                                                          
        #为计算机对象定义计算机类型 
        $computerproperty|  Add-Member -MemberType NoteProperty -Name "计算机内存大小(GB)" -Value $currentmemory                                                         
        #为计算机对象定义计算机内存属性                                                               
        $computerproperty|  Add-Member -MemberType NoteProperty -Name "计算机硬盘大小(GB)" -Value $currentharddisk                                                         
        #为计算机对象定义计算机硬盘属性
        $computerproperty|  Add-Member -MemberType NoteProperty -Name "C盘可用空间大小(GB)" -Value $currentdiskcfreesize                                                         
        #为计算机对象定义计算机C盘可用空间属性                                                                       
        $allcomputername=$allcomputername+$computerproperty                                                                                                  
        #根据对象的轮询将当前对象的属性加入到哈希数组中             
        }      
      }  
        if(!(Test-Path C:\统计计算机资产 -pathType container))
        {
        New-Item c:\统计计算机资产 -type directory
        }
        else {"C:\统计计算机资产文件夹已存在,不需要在创建"}
        #C盘下创建文件夹统计计算机资产,用于统一存放每天的生成的CSV文件            
        $tmplogfile="c:"+"\统计计算机资产\"+$(get-date -Format "yyyy-MM-dd")+".csv"                                                                                         
        #定义输出文件的路径和文件格式
        $allcomputername| Export-Csv -Encoding default -NoTypeInformation -Path $tmplogfile                                                                  
        #将数据导出为csv 文件,我们直接通过CSV 文件来获取希望拿到的信息        
        $UserName = "[email protected]"      #定义发送账户名称
        $Password = ConvertTo-SecureString "123456" -AsPlainText –Force
        $cred = New-Object System.Management.Automation.PSCredential($UserName,$Password) 
        Send-MailMessage -From "[email protected]" -To "[email protected]" -Subject "计算机硬件信息汇总" -Credential $cred -SmtpServer "mail.yuntcloud.com" -Attachments $tmplogfile -Encoding ([System.Text.Encoding]::UTF8)

思路之一:

$a=""|select "计算机类型","计算机名"
$a.计算机类型+="a"
$a.计算机名+="b"
$a

输出结果为:

修改后的powershell如下:

#统计ip、MAC地址、计算机名、登录用户、计算机配置、主机序列号、硬盘序列号、计算机型号、windows及SP的版本、C盘可用空间
#防火墙开启windows远程管理、windows防火墙允许入站远程管理
#编写:周平 QQ:185426445 联系方式:18666943750 欢迎技术交流和提出修改意见
Import-Module activedirectory                                                   
#导入其中的AD 模块
$computeraccount=Get-ADComputer -Filter * -Properties * |?{($_.OperatingSystem -ne $null) -and ($_.enabled) -and ($_.IPv4Address -ne $null) }|select -ExpandProperty name         
#获取当前AD 计算机中的所有机器NETBIOS名称,排除禁用的,无操作系统类型、没有IP的
[email protected]()                                                            
#定义所有计算机的初始空值
foreach ($currentcomputename in $computeraccount)                               
#根据计算机对象进行轮询
      { 
        if (Test-NetConnection $currentcomputename|select -ExpandProperty PingSucceeded) `
        #测试计算机是否可以ping通,如果可以ping通,则继续执行
        {
        $currentcomputename+"正测试IP连通性..."   
        $currentname= Get-ADComputer -Identity $currentcomputename|select -ExpandProperty name         
        #获取机器的NETBIOS名称       
        $currentuser=(Get-WmiObject Win32_Process -Filter ‘Name="explorer.exe"‘ -ComputerName $currentcomputename).getOwner() | Select -ExpandProperty User
        #获取机器的当前登录用户 
        $currentoperatingsystem= Get-ADComputer -Identity $currentcomputename -Properties * |select -ExpandProperty OperatingSystem          
        #获取机器的操作系统版本  
        $currentoperatingsystemsp= Get-ADComputer -Identity $currentcomputename -Properties * |select -ExpandProperty OperatingSystemServicePack          
        #获取机器的操作系统SP版本                                   
        $currentclass= Get-WmiObject -class Win32_BIOS -computername $currentcomputename -namespace "root\cimv2" |select -ExpandProperty SerialNumber        
        #通过获取WMI中的bios 类获取到机器相应的序列号,存放在BIOS的SN
        $currentIP= Get-WmiObject -class Win32_NetworkAdapterConfiguration -computername $currentcomputename -Filter IPEnabled=true |select -ExpandProperty IPAddress -First 1 |?{$_ -notlike "*:*" -and $_ -notlike "169*"}   
        #通过获取WMI中的IPV4地址
        $currentMAC= Get-WmiObject -class Win32_NetworkAdapterConfiguration -computername $currentcomputename -Filter IPEnabled=true -Property * |?{$_.IPAddress -match $currentIP} |select -ExpandProperty macaddress -First 1 
        #通过获取WMI中的MAC地址       
        $currentdiskSN=  Get-WmiObject -Class Win32_DiskDrive -computername $currentcomputename |select -First 1 -ExpandProperty Model        
        #通过获取WMI中的硬盘BIOS序列号
        $currentpcmodel=  Get-WmiObject -Class Win32_ComputerSystem -computername $currentcomputename -Property * |select -ExpandProperty Model        
        #通过获取WMI中的计算机类型       
        $currentmemory=  (Get-WmiObject -Class Win32_ComputerSystem -computername $currentcomputename -Property * |select -ExpandProperty TotalPhysicalMemory)/1gb -as [int]       
        #通过获取WMI中的计算机内存   
        $currentharddisk=  (Get-WmiObject -Class Win32_DiskDrive -computername $currentcomputename|select -First 1 -ExpandProperty size)/1gb  -as [int]      
        #通过获取WMI中的硬盘大小   
        $currentdiskcfreesize=  ((Get-WMIObject Win32_LogicalDisk -ComputerName $currentcomputename | ? { $_.deviceid -match "c" }).freespace)/1GB -as [int]      
        #通过获取WMI中的C盘可用空间大小                 
        $allcomputername1=""|select "计算机名","登录用户名","主机序列号","IP地址","MAC地址","硬盘序列号","操作系统版本","操作系统SP版本","计算机类型","计算机内存大小","计算机硬盘大小","C盘可用空间大小"
        $allcomputername1.计算机名+=$currentname
        $allcomputername1.登录用户名+=$currentuser
        $allcomputername1.主机序列号+=$currentclass
        $allcomputername1.IP地址+=$currentip
        $allcomputername1.MAC地址+=$currentmac
        $allcomputername1.硬盘序列号+=$currentdisksn
        $allcomputername1.操作系统版本+=$currentoperatingsystem
        $allcomputername1.操作系统SP版本+=$currentoperatingsystemsp
        $allcomputername1.计算机类型+=$currentpcmodel
        $allcomputername1.计算机内存大小+=$currentmemory
        $allcomputername1.计算机硬盘大小+=$currentharddisk
        $allcomputername1.C盘可用空间大小+=$currentdiskcfreesize
        $allcomputername+=$allcomputername1                                       
        }      
      }  
        if(!(Test-Path C:\统计计算机资产 -pathType container))
        {
        New-Item c:\统计计算机资产 -type directory
        }
        else {"C:\统计计算机资产文件夹已存在,不需要在创建"}
        #C盘下创建文件夹统计计算机资产,用于统一存放每天的生成的CSV文件             
        $tmplogfile="c:"+"\统计计算机资产\"+$(get-date -Format "yyyy-MM-dd")+".csv"                                                                                         
        #定义输出文件的路径和文件格式
        $allcomputername| Export-Csv -Encoding default -NoTypeInformation -Path $tmplogfile                                                                  
        #将数据导出为csv 文件,我们直接通过CSV 文件来获取希望拿到的信息        
        $UserName = "[email protected]"      #定义发送账户名称
        $Password = ConvertTo-SecureString "123456" -AsPlainText –Force
        $cred = New-Object System.Management.Automation.PSCredential($UserName,$Password) 
        Send-MailMessage -From "[email protected]" -To "[email protected]" -Subject "计算机硬件信息汇总" -Credential $cred -SmtpServer "mail.yuntcloud.com" -Attachments $tmplogfile -Encoding ([System.Text.Encoding]::UTF8)

思路之二:

还可以考虑使用-append参数代替数组递加

#统计ip、MAC地址、计算机名、登录用户、计算机配置、主机序列号、硬盘序列号、计算机型号、windows及SP的版本、C盘可用空间
#防火墙开启windows远程管理、windows防火墙允许入站远程管理
#编写:周平 QQ:185426445 联系方式:18666943750 欢迎技术交流和提出修改意见
Import-Module activedirectory                                                   
#导入其中的AD 模块
$computeraccount=Get-ADComputer -Filter * -Properties * |?{($_.OperatingSystem -ne $null) -and ($_.enabled) -and ($_.IPv4Address -ne $null) }|select -ExpandProperty name         
#获取当前AD 计算机中的所有机器NETBIOS名称,排除禁用的,无操作系统类型、没有IP的
[email protected]()                                                            
#定义所有计算机的初始空值
        if(!(Test-Path C:\统计计算机资产 -pathType container))
        {
        New-Item c:\统计计算机资产 -type directory
        }
        else {"C:\统计计算机资产文件夹已存在,不需要在创建"}
        #C盘下创建文件夹统计计算机资产,用于统一存放每天的生成的CSV文件            
        $tmplogfile="c:"+"\统计计算机资产\"+$(get-date -Format "yyyy-MM-dd")+".csv"                                                                                         
        #定义输出文件的路径和文件格式
foreach ($currentcomputename in $computeraccount)                               
#根据计算机对象进行轮询
      { 
        if (Test-NetConnection $currentcomputename|select -ExpandProperty PingSucceeded) `
        #测试计算机是否可以ping通,如果可以ping通,则继续执行
        {
        $currentcomputename+"正测试IP连通性..."   
        $currentname= Get-ADComputer -Identity $currentcomputename|select -ExpandProperty name         
        #获取机器的NETBIOS名称       
        $currentuser=(Get-WmiObject Win32_Process -Filter ‘Name="explorer.exe"‘ -ComputerName $currentcomputename).getOwner() | Select -ExpandProperty User
        #获取机器的当前登录用户 
        $currentoperatingsystem= Get-ADComputer -Identity $currentcomputename -Properties * |select -ExpandProperty OperatingSystem          
        #获取机器的操作系统版本  
        $currentoperatingsystemsp= Get-ADComputer -Identity $currentcomputename -Properties * |select -ExpandProperty OperatingSystemServicePack          
        #获取机器的操作系统SP版本                                   
        $currentclass= Get-WmiObject -class Win32_BIOS -computername $currentcomputename -namespace "root\cimv2" |select -ExpandProperty SerialNumber        
        #通过获取WMI中的bios 类获取到机器相应的序列号,存放在BIOS的SN
        $currentIP= Get-WmiObject -class Win32_NetworkAdapterConfiguration -computername $currentcomputename -Filter IPEnabled=true |select -ExpandProperty IPAddress -First 1 |?{$_ -notlike "*:*" -and $_ -notlike "169*"}   
        #通过获取WMI中的IPV4地址
        $currentMAC= Get-WmiObject -class Win32_NetworkAdapterConfiguration -computername $currentcomputename -Filter IPEnabled=true -Property * |?{$_.IPAddress -match $currentIP} |select -ExpandProperty macaddress -First 1 
        #通过获取WMI中的MAC地址       
        $currentdiskSN=  Get-WmiObject -Class Win32_DiskDrive -computername $currentcomputename |select -First 1 -ExpandProperty Model        
        #通过获取WMI中的硬盘BIOS序列号
        $currentpcmodel=  Get-WmiObject -Class Win32_ComputerSystem -computername $currentcomputename -Property * |select -ExpandProperty Model        
        #通过获取WMI中的计算机类型       
        $currentmemory=  (Get-WmiObject -Class Win32_ComputerSystem -computername $currentcomputename -Property * |select -ExpandProperty TotalPhysicalMemory)/1gb -as [int]       
        #通过获取WMI中的计算机内存   
        $currentharddisk=  (Get-WmiObject -Class Win32_DiskDrive -computername $currentcomputename|select -First 1 -ExpandProperty size)/1gb  -as [int]      
        #通过获取WMI中的硬盘大小   
        $currentdiskcfreesize=  ((Get-WMIObject Win32_LogicalDisk -ComputerName $currentcomputename | ? { $_.deviceid -match "c" }).freespace)/1GB -as [int]      
        #通过获取WMI中的C盘可用空间大小                       
        $computerproperty=New-Object  psobject                                                                                                               
        #定义一个新PS 对象
        $computerproperty|  Add-Member -MemberType NoteProperty -Name "计算机名" -Value  $currentname                                                        
        #为新的对象定义计算机名称属性
        $computerproperty|  Add-Member -MemberType NoteProperty -Name "登录用户名" -Value  $currentuser                                                        
        #为新的对象定义计算机当前登录用户名属性
        $computerproperty|  Add-Member -MemberType NoteProperty -Name "主机序列号" -Value $currentclass                                                          
        #为计算机对象定义序列号属性   
        $computerproperty|  Add-Member -MemberType NoteProperty -Name "IP地址" -Value $currentip                                                          
        #为计算机对象定义IP地址属性
        $computerproperty|  Add-Member -MemberType NoteProperty -Name "MAC地址" -Value $currentMAC                                                          
        #为计算机对象定义MAC地址属性   
        $computerproperty|  Add-Member -MemberType NoteProperty -Name "硬盘序列号" -Value $currentdisksn                                                          
        #为计算机对象定义硬盘序列号属性  
        $computerproperty|  Add-Member -MemberType NoteProperty -Name "操作系统版本" -Value $currentoperatingsystem                                                          
        #为计算机对象定义操作系统版本   
        $computerproperty|  Add-Member -MemberType NoteProperty -Name "操作系统SP版本" -Value $currentoperatingsystemsp                                                          
        #为计算机对象定义操作系统SP版本   
        $computerproperty|  Add-Member -MemberType NoteProperty -Name "计算机类型" -Value $currentpcmodel                                                          
        #为计算机对象定义计算机类型 
        $computerproperty|  Add-Member -MemberType NoteProperty -Name "计算机内存大小(GB)" -Value $currentmemory                                                         
        #为计算机对象定义计算机内存属性                                                               
        $computerproperty|  Add-Member -MemberType NoteProperty -Name "计算机硬盘大小(GB)" -Value $currentharddisk                                                         
        #为计算机对象定义计算机硬盘属性
        $computerproperty|  Add-Member -MemberType NoteProperty -Name "C盘可用空间大小(GB)" -Value $currentdiskcfreesize                                                         
        #为计算机对象定义计算机C盘可用空间属性                                                                      

        $computerproperty| Export-Csv -Encoding default -NoTypeInformation -Path $tmplogfile -append                                                               
        #将数据导出为csv 文件,我们直接通过CSV 文件来获取希望拿到的信息   
             
        }      
      }  
     
        $UserName = "[email protected]"      #定义发送账户名称
        $Password = ConvertTo-SecureString "123456" -AsPlainText –Force
        $cred = New-Object System.Management.Automation.PSCredential($UserName,$Password) 
        Send-MailMessage -From "[email protected]" -To "[email protected]" -Subject "计算机硬件信息汇总" -Credential $cred -SmtpServer "mail.yuntcloud.com" -Attachments $tmplogfile -Encoding ([System.Text.Encoding]::UTF8)
时间: 2024-08-09 03:16:34

Powershell管理系列(三十六)PowerShell操作之统计域内计算机硬件资产的相关文章

Powershell管理系列(三十七)PowerShell操作之统计域内计算机硬件资产

-----提供AD\Exchange\Lync\Sharepoint\CRM\SC\O365等微软产品实施及外包,QQ:185426445.电话18666943750 需求:有时候我们需要比较powershell程序每天自动获取的CSV文件报表,用来确定每天发生的变化,如下:我们比较前后两天自动生成的CSV文件的列"计算机名". 脚本如下: diff -ReferenceObject (import-csv C:\统计计算机资产\2016-11-26.csv -Encoding def

Powershell管理系列(十六)在PowerShell中添加Exchange管理单元

-----提供AD\Exchange\Lync\Sharepoint\CRM\SC\O365等微软产品实施及外包,QQ:185426445.电话18666943750 每次都找那个Exchange命令行管理程序太麻烦了,其实我们可以更简单,可以直接在PowerShell控制台内直接调用Exchange的管理命令就好了. 以下是Powershell调用各个版本的Exchange. Exchange 2007 Add-PSSnapin Microsoft.Exchange.Management.Po

Powershell管理系列(十二)Exchange新启用的邮箱禁用OWA及Activesync的访问

-----提供AD\Exchange\Lync\Sharepoint\CRM\SC\O365等微软产品实施及外包,QQ:185426445.电话18666943750 今天在一个群里听到这样一个需求,新建一批AD账户后,对这些AD账户启用邮箱,同时要对这些邮箱设置规则,禁止访问OWA和Activesync的权限. 步骤1.批量建立AD账号参考博客Powershell管理系列(一)Active Direcrtory管理:用户管理,http://yuntcloud.blog.51cto.com/11

Powershell管理系列(十七)PowerShell操作之定时删除过时文件

-----提供AD\Exchange\Lync\Sharepoint\CRM\SC\O365等微软产品实施及外包,QQ:185426445.电话18666943750 开篇前,先说点新年感悟,2010开博5年来,前面两年没怎么动手写博客,真正开始写博客的时间是2013年,那时候Exchange server 2013刚出来不久,全新的软件,全新的界面,全新的体验,当然也带来全新的挑战,那就是我们这些追随微软脚步的工程师又得一次跟上巨人的脚步了,从Exchange server 2003,到后面的

Powershell管理系列(十九)PowerShell操作之修改Exchange数据库报警时间

-----提供AD\Exchange\Lync\Sharepoint\CRM\SC\O365等微软产品实施及外包,QQ:185426445.电话18666943750 需求:Exchange用户满的提示是默认的发送系统提示邮件时凌晨1点,想改到早上8点. 步骤1.我们首先找到数据库,属性点开,默认的警告邮件间隔是每日1:00运行 步骤2.逐个修改数据库属性,我们修改成早上8点,注意时间间隔要15分钟以上. technet参考截图: 设置如下: 步骤3.查询下是否生效. 步骤4.数据库比较多的时候

Powershell管理系列(十五)查询最近一个月未登录的AD账号和Exchange账号

-----提供AD\Exchange\Lync\Sharepoint\CRM\SC\O365等微软产品实施及外包,QQ:185426445.电话18666943750 今天听到群里有朋友问,想查询最近1个月未登录的AD账号,我们可以通过如下的Powershell来实现: 需求1.查询OU中所有账号的创建时间\SID\上次修改密码时间\最后一次登录时间 PowerShell查询指定OU中所有账号的创建时间\SID\上次修改密码时间\最后一次登录时间,可以通过如下命令完成:PS C:\Users\a

Powershell管理系列(十)邮件联系人及邮件用户的管理

鉴于有些用户不太熟悉邮件联系人.邮件用户的区别,博文首先介绍下用户邮箱.邮件联系人.邮件用户的概念,以下介绍部分博文摘自winos微软中文技术论坛. ----------------------------------------------------------------------------------------------------- a)        用户邮箱:最最常见的应该就是这种.我们给一个域账号启用了邮箱,那么这个用户邮箱就是一个典型的收件人.用户邮箱通常包含邮件.日历

BizTalk开发系列(三十六) Orchestration单实例执行

BizTalk 是高效的消息处理引擎,采用多线程并发的方式来处理消息.也就是说当有消息被接收的时候就会产生一个新的消息处理实例.但有时目标系统可能并没有并发处理 的能力, 这时就需要在BizTalk中采用单实例的方式来处理消息.在BizTalk的管道中直接可以启用按序送达的方式来实现, 但是在Orchestration中并没有提供类似的选项.该如何做到呢? 其实在BizTalk中可以根据设置消息的Correlation Set也就是相关属性来实现这样的效果.也就是第一条消息进来之后创建一个Orc

Powershell管理系列(二十六)PowerShell操作之批量导出&导入邮箱

-----提供AD\Exchange\Lync\Sharepoint\CRM\SC\O365等微软产品实施及外包,QQ:185426445.电话18666943750 项目中有时候做跨林邮箱迁移的时候,条件不成熟,比如安全考虑或者其他考虑,不能做双林信任,这样就提出了一个问题,历史邮件需要使用的话怎么办,一个简单高效的解决办法就是从源森林批量导出邮件为.pst文件,在批量导入到目的域森林,具体操作如下: 1.赋予管理账号邮件导入导出权限,命令如下: cls whoami New-Manageme