donderdag 24 maart 2011

Setting IP restrictions on your central administration server in IIS with PowerShell

To set an IP restriction on your central administration with PowerShell you need to do the following:

- First set deny all
Set-WebConfigrationProperty –Filter system.webServer/security/ipSecurity –PSPath ‘IIS:\’ –Name allowUnlisted –Location “SharePoint Central Administration v4” –Value $false

- Second set allow for a specific IP Address
Add-WebConfiguration system.webServer/security/ipSecurity –location “IIS:\Sites\SharePoint Central Administration v4” –Value @{ipAddress=”$(Get-IPAddress)”;allowed=”true”} –PSPath IIS:\

The Get-IPAddress function is a function to get the IP address of the current PC:

function Get-IPAddress() {

return (gwmi Win32_NetworkAdapterConfiguration |? { $_.IPAddress –ne $null }).IPAddress

}

2 opmerkingen:

Julie Malone zei

A professionally crafted professional logo designs is one of the greatest blessings for a company; whether it is big or small. It gives them an identity of their own and makes them different from others.

Blogger zei

BlueHost is ultimately the best hosting provider for any hosting services you need.