Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Introduction to PowerShell command

2025-03-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

PowerShell commands are formed in the form of verb-noun

Get-date

The command itself is case-insensitive

In addition to viewing dates, we can also view services (Get-Service), view processes (Get-Prosses), and so on.

PowerShell provides IntelliSense. You only need to enter the Get-Stor in front of you, and then press the Tab key to automatically sense the band.

Each command has some parameters, some are optional, some are mandatory, each parameter can accept one or more parameter values, of course, there are also some switch parameters, without the need for parameter values

Query help get-help get-date

How do we find the commands we want to use?

Suppose I now look up the command to view the physical disk

We can search get-command disk like this.

Because you just need to check, try to narrow it down to get-command-verb get- noun disk.

And finally found get-physicaldisk.

PowerShell has strong extensibility, and many products of Microsoft and third-party manufacturers integrate PowerShell commands.

Such as Microsoft's own Active Directory, Exchange, Lync\ SFB, SharePoint, SCCM, SCOM, SQL Server

Or VmWare's vCenter of third-party vendors, XenDesktop of Citrix, etc.

These PowerShell commands that manage specific products are based on extensions to Windows PowerShell.

Management Unit (PSSnapin)

Module (Module)

The snap-in typically contains one or more DLL files, along with XML and help files for configuration settings. But the concept of the snap-in is being gradually removed and will become less and less in the future.

The module is more independent and can be used without complex registration.

Use Get-PSSnapin-Registered view to determine the extensions owned by the current computer

Add the snap-in you want to use through the Add-PSSnapin command

Add the snap-in you want to use through the Add-PSSnapin command to add-pssnapin microsoft.sharepoint.powershell

Now you are ready to use the extension command get-spsite

Next, try to add modules, and again, let's try to look at the modules we have.

Get-module-listavailable

Import the module import-module activedirectory using the command

You can now manage AD through PowerShell, get-addomain

Here are some basic questions, be sure to do it if you are interested:

How to view the running status of wuauserv services

Get-Service wuauserv

How to stop the wuauserv service

Stop=service wuauserv

How to view explorer processes

Get-process explorer

Those who have server conditions can try the following actions

View AD users under a specific OU

Get-aduser-searchbase "ou=xxx,dc=xxx,dc=xxx"

View all Exchange users

Get-mailbox

Create a new Exchange mailbox

New-mailbox

View the transfer log from the day before to today

Get-message trackinglog-start "2018-4-9"-end "2018-4-10"

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report