title: How to set unique ID as IP address in a powershell script
body: <p>I'm working on a script in Power shell to apply lock on VMs from a list of subscription name and IP address, I need the unique ID to be IP address.</p>
  <pre><code>
  function lockVms {
      param (
          $vmList, $lockParams
      )
      $uniqueSubs = $vmList.sub | Sort-Object | Get-Unique
   
      foreach ($sub in $uniqueSubs) {
          Select-AzSubscription -SubscriptionId $sub
          foreach ($line in $vmList) {
              if ($line.sub -contains $sub) {
                  applyLock -line $line -lockParams $lockParams
              }
          }
      }
  </code></pre>