配置打印机端口,例如添加或删除TCP/IP端口,这对于网络打印机尤其重要。 powershellCopy Code # 添加TCP/IP打印端口 Add-PrinterPort -Name "端口名称" -PrinterHostAddress "打印机IP地址" # 删除打印端口 Remove-PrinterPort -Name "端口名称" 5. 打印配置备份与恢复 备份和恢复打印服务器的配置,这对于灾难恢复...
$OutputObj | Add-Member -MemberType NoteProperty -Name MACAddress -Value $MACAddress $OutputObj } } } } end {} 步骤: 将上面代码保存为PS1文件。例如: GetIP.ps1 准备好一个远程主机的列表名文件(TXT文件格式),例如; Computer_List.txt 在PowerShell下执行下面的任意一个命令: Get-Content Computer_...
设置动态获取IP地址: netsh interface ip set address name="以太网" source=dhcp 设置固定IP: netshinterface ip set addressname="以太网"source=static addr=192.168.0.10 mask=255.255.255.0 gateway=192.168.0.1 参数说明: 1.name:网络连接名称,一般为“本地连接”。你可以在“控制面板”->“网络连接”中看到。
wmic DESKTOPMONITOR where Status='ok' get ScreenHeight,ScreenWidth //获取屏幕分辨率 wmic qfe get hotfixid //获取补丁信息 wmic product get name //获取安装软件信息 wmic computersystem get Manufacturer,Model,Name //获取计算机信息 wmic MEMORYCHIP get Capacity,DeviceLocator,Manufacturer,SerialNumber,Speed ...
To target a remote computer, simply add the parameter "-ComputerName server01" to gwmi/Get-WmiObject. Pipe to Get-Member instead of Select to see all properties, or Select * - or Format-List *.From WSUSIf you have WSUS set up against the desired target computers, this will be an easy...
TypeName: Microsoft.Management.Infrastructure.CimInstance#root/cimv2/Win32_NetworkAdapterConfiguration Name MemberType Definition --- --- --- IPAddress Property string[] IPAddress {get;} 每个网络适配器的 IPAddress 属性实际上是一个数组。 定义中的大括号表示IPAddress不是System.String值,而是System.Strin...
建立主要公用 IP 位址 使用New-AzPublicIpAddress 建立主要公用 IP 位址。 Azure PowerShell 複製 開啟Cloud Shell $ip1 = @{ Name = 'myPublicIP-1' ResourceGroupName = 'myResourceGroup' Location = 'eastus2' Sku = 'Standard' AllocationMethod = 'Static' IpAddressVersion = 'IPv4...
[-ComputerName <String> ] [-EntrypointName <String> ] [-InformationAction <System.Management.Automation.ActionPreference> {SilentlyContinue | Stop | Continue | Inquire | Ignore | Suspend} ] [-InformationVariable <System.String> ] [-IPAddressRange <String[]> ] [-IPv6Prefix <Str...
powershell脚本之-AD域内查询网卡ipv4 mac地址,#Get-mac.ps1<#.SynopsisGet physical adapters network ipv4 mac.DescriptionDisplay all physical adapters mac from the ipconfig /all..Parameter ComputernameThe name of the computer to check..E
Building a string from a Get-ADComputer output adds @{Name= to the computer name Bulk adding Active Directory users to a group by Display Name with PowerShell Bulk change of email addresses in Active Directory from a csv file Bulk Delete Computer from AD using list of partial names Bulk de...