This paper introduces the properties and methods of the date objects obtained by using Get-date in PowerShell, and makes good use of these objects and methods, which can greatly enhance the flexibility of our development.
Using Get-date, you can get a time object, which is not just a simple way to output the current t
Powershell script to get site title, site owner, site user count and usageAdd-pssnapin Microsoft. sharepoint. powershell-erroraction silentlycontinue $ wburl = read-host "Enter web application URL" $ webapp = Get-spwebapplication $ wburl $ outputpath = read-host "Enter path to save results" Add-content -Path $ outputpa
In general, in order to detect whether the specified TCP port is alive, we are determined by the port specified by Telnet to see if there is a response, but by default WIN8 system does not install Telnet. Imagine if you hacked into a server without Telnet, but in order to penetrate into the intranet, you need to detect if the internal server specific port is open, and you are not willing to install Telnet, for the attention of administrators. Well, in this case you need my this script. Since it
Because I often perform operations in Working Group mode, you must enter creden。 when Remotely Managing other hosts. Generally, Get-Credential is used to pop up a prompt box and enter the password.
For example:
$ C = Get-Credential DBA_UserGet-WmiObject-Credential $ c-Class Win32_LogicalDisk-ComputerName 10.0.0.10
It is okay to query only one remote host. to query many hosts, you have to enter the passwo
. Sharepoint. Administration. spwebservice]: contentservice. applicationpoolsPS c: \ Users \ administrator. VSAT> $ pool3 = $ pools | where {$ _. Name-EQ "SharePoint hosting pool "}
Note: The app pool used by Sharepoint Services does not display the name in IIS, And the guid corresponding to it is displayed.
The following command can help you map the ID and name.
PS c: \ Users \ administrator. VSAT> $ svcpools = Get-spserviceapplication
Introduction to group Common properties:First, Get-adgroup get the group (the following example loops to get the group's send permission)#Send permissions for groups info$groups=get-adgroup-Filter*-searchscope Subtree-searchbase"ou=xx,ou=xx,dc=xx,dc=xx,dc=xx" #Get group name
Get-spwebGets the specified subsite.Parameters
Identity: Specifies the address of the subsite.
Limit: Limits the maximum number of subsites to return, the default value is 200; To return to all sites, enter all.
Site: Specifies the address or GUID of the site collection that gets the subsite.
ExampleGet-spweb-site http://sitename/sites/site1Set-spwebSets the specified subsite.Parameters
Identity: The subsite address or object that ne
There are times when you need to connect multiple machines to get their classes, but sometimes we find that computers can't connect.Please change the following configuration in Group Policy:Able to use Gpmc.msc for later. Local Computer Policy--Computer Configuration--Administrative Templates--network--Network connection--window Firewall--Consent to remote management enabledFor example, the following:Use PowerShel
A question from a little brother in the groupUsing PowerShell to write is much simpler than C #, WMI provides the method directly and invokes it.
#made by Kukisama
$a = (get-wmiobject-class win32_physicalmemory -namespace "root\cimv2"). Capacity
$b = (get-wmiobject-class win32_perfformatteddata_perfos_memory -namespace "root\cimv2"). AvailableMbytes
$c =
The prerequisite is to install the RSAT tool for WIN10, which will have the appropriate PowerShell module to manage DHCP
Also have permissions to query the DHCP server
Add the following code to $profilefunction get-dhcplease{ $dhcpservers =get-dhcpserverindc $dhcpscopes = $dhcpservers |%{$computername =$_. Dnsname
Introduced
Site startup, stop, application pool back or expiration (Time out), received requests and sent responses, AppDomains (application domain) of a large number of
Build and close. IIS7 implements a so-called RSCA interface (run-time State and control API) that allows you to monitor what the current system is doing
Job.
IIS 7.0 PowerShell Provider uses this interface and exposes some of its data information in the IIS Provider name space. Th
Applicable: Exchange 2010Get-activesyncdeviceclass:exchange Online Helphttps://technet.microsoft.com/zh-cn/library/ff731393 (v=exchg.150). aspxThe following command filters the specific properties and then exports the results to a TXT file.650) this.width=650; "title=" C5c855a6225244bc96e6cfa4e7434dd8 "style=" border-top:0px;border-right:0px; border-bottom:0px;border-left:0px; "border=" 0 "alt=" c5c855a6225244bc96e6cfa4e7434dd8 "src=" http://s3.51cto.com/ Wyfs02/m01/78/15/wkiom1z1v4tistfwaaa1e_4
This command can be used if we want to obtain the related properties of a solution package before we describe the commands for manipulating the WSP solution package.Parameters
Deployed: Gets whether the solution has been deployed to the server farm
Deployedservers: Gets the name of the server to which this solution package is deployed
Deployedwebapplications: Gets the name of the Web application to which this solution package is deployed
Deploymentstate: Gets whether this solution
When you run a script, sometimes you need to do something with a relative path to the location of the script file, such as executing another script. Previously in the CMD era, you can use%~dp0 to get the folder where the script resides, what to do in the PowerShell?
Very simply, through the built-in $myinvocation variables:
Copy Code code as follows:
$x = $MyInvocation. mycommand.definition
A
Applies to PowerShell or later versions
Starting with PowerShell 30, the PowerShell itself does not have a bundle of help documents. The user has to use the command update-help to update the PowerShell help document and download it to the locally protected PowerShell folder
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.