From 1fd0d4ec21d2a0fd98e83d1dc2ead901473b1004 Mon Sep 17 00:00:00 2001 From: phbits Date: Wed, 27 Jan 2021 00:44:31 +0000 Subject: [PATCH 1/4] Create sample7.ps1 --- .../security/ipSecurity/add/samples/sample7.ps1 | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 iis/configuration/system.webServer/security/ipSecurity/add/samples/sample7.ps1 diff --git a/iis/configuration/system.webServer/security/ipSecurity/add/samples/sample7.ps1 b/iis/configuration/system.webServer/security/ipSecurity/add/samples/sample7.ps1 new file mode 100644 index 000000000..477dc47ca --- /dev/null +++ b/iis/configuration/system.webServer/security/ipSecurity/add/samples/sample7.ps1 @@ -0,0 +1,7 @@ +Start-IISCommitDelay + +$iisIpSecurity = Get-IISConfigSection -CommitPath 'Default Web Site' -SectionPath 'system.webServer/security/ipSecurity' | Get-IISConfigCollection +New-IISConfigCollectionElement -ConfigCollection $iisIpSecurity -ConfigAttribute @{ 'ipAddress' = '192.168.100.1'; 'allowed' = $false } +New-IISConfigCollectionElement -ConfigCollection $iisIpSecurity -ConfigAttribute @{ 'ipAddress' = '169.254.0.0'; 'subnetMask' = '255.255.0.0'; 'allowed' = $false } + +Stop-IISCommitDelay From b3afcbe53d015901e727422fdd57ce1bb0de5435 Mon Sep 17 00:00:00 2001 From: phbits Date: Wed, 27 Jan 2021 00:54:12 +0000 Subject: [PATCH 2/4] Create sample8.ps1 --- .../security/ipSecurity/index/samples/sample8.ps1 | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 iis/configuration/system.webServer/security/ipSecurity/index/samples/sample8.ps1 diff --git a/iis/configuration/system.webServer/security/ipSecurity/index/samples/sample8.ps1 b/iis/configuration/system.webServer/security/ipSecurity/index/samples/sample8.ps1 new file mode 100644 index 000000000..cb73920c8 --- /dev/null +++ b/iis/configuration/system.webServer/security/ipSecurity/index/samples/sample8.ps1 @@ -0,0 +1,3 @@ +$iisIpSecurity = Get-IISConfigSection -CommitPath 'Default Web Site' -SectionPath 'system.webServer/security/ipSecurity' + +Set-IISConfigAttributeValue -ConfigElement $iisIpSecurity -AttributeName 'enableReverseDns' -AttributeValue $true From 0982ad1c323b1aef548c6f88b3885c525f92e79c Mon Sep 17 00:00:00 2001 From: phbits Date: Wed, 27 Jan 2021 00:58:54 +0000 Subject: [PATCH 3/4] added PowerShell sample link --- iis/configuration/system.webServer/security/ipSecurity/add.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/iis/configuration/system.webServer/security/ipSecurity/add.md b/iis/configuration/system.webServer/security/ipSecurity/add.md index 486705303..645f316c9 100644 --- a/iis/configuration/system.webServer/security/ipSecurity/add.md +++ b/iis/configuration/system.webServer/security/ipSecurity/add.md @@ -179,3 +179,7 @@ The following code samples add two IP restrictions to the Default Web Site; the ### VBScript [!code-vb[Main](add/samples/sample6.vb)] + +### PowerShell + +[!code-powershell[Main](add/samples/sample7.ps1)] From d0abf0962c62d6fd6e0cacee9f84eedecd83adbe Mon Sep 17 00:00:00 2001 From: phbits Date: Wed, 27 Jan 2021 01:01:10 +0000 Subject: [PATCH 4/4] added PowerShell sample link --- .../system.webServer/security/ipSecurity/index.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/iis/configuration/system.webServer/security/ipSecurity/index.md b/iis/configuration/system.webServer/security/ipSecurity/index.md index 13e37d9ad..87ea2d62c 100644 --- a/iis/configuration/system.webServer/security/ipSecurity/index.md +++ b/iis/configuration/system.webServer/security/ipSecurity/index.md @@ -187,3 +187,7 @@ The following code samples enble reverse DNS lookups for the default web site. ### VBScript [!code-vb[Main](index/samples/sample7.vb)] + +### PowerShell + +[!code-powershell[Main](index/samples/sample8.ps1)]