Power shell Script to add IP address to it's IIS bindings

Kannagatla, Swamy 61 Reputation points
2021-08-20T16:25:32.803+00:00

Hello All,

I want to create a script in SCCM console where in it will deploy to a collection with below script conditions.

Can someone please help me with a power shell script where I want to add the machines IP address to it's IIS bindings.

Regards,
Swamy.

Windows for business Windows Server User experience PowerShell
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Rich Matheisen 47,901 Reputation points
    2021-08-20T18:24:05.357+00:00

    Does no one do web searches anymore???

    Set-WebBinding

    set-webbinding


  2. Rich Matheisen 47,901 Reputation points
    2021-08-20T20:08:42.397+00:00

    A machine usually has more than one IP address, maybe both IPv4 and IPv6, and possibly more than one NIC. You can use Get-NetIpAddress to get those addresses and you can be specific about which NICs you want to use. But how you name those interfaces and what their indexes are you'll have to determine. I imagine they'll differ from machine to machine unless all your machines are configured identically with the NICs in the same slots.

    As for a script, what have you tried so far? Post it here if you need help with it or have a question about it.


  3. MotoX80 36,291 Reputation points
    2021-08-21T11:48:37.787+00:00

    IP address of the machine should be added to IIS bindings on the same machine.

    You don't need to do that unless you have multiple IP addresses. The default binding is "*" which equates to any IP on the machine.

    If you have multiple IP's and multiple sites, then you would need a DSC type script to define a specific application/site/IP on a given machine.

    125179-capture.jpg

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.