Forum Replies Created

Viewing 4 reply threads
  • Author
    Posts
    • #1554434
      PowerMe!
      Participant
      Member Points: 1,217
      Rank: 3

      Ah, thank you so much, got it.

      0
    • #1554420
      PowerMe!
      Participant
      Member Points: 1,217
      Rank: 3

      Thank you- that’s what I looking for- lost the reference to it! Would you mind explaining a bit more on that syntax? Is there a reference  can follow?

      @{l="IPaddress";e={$_.Ipv4address.ipaddress}}
      
      

      @{…} you define an indexed array

      • I presume “l” is label
      • what’s “e” – I see that it has the property

      I ended up doing a similar but somewhat elaborate way by defining a custom array as below.

      foreach($int in (get-netipconfiguration -All)){
      $arr = @()
      $arr = [PSCustomObject]@{
      IntID = $int.InterfaceIndex
      IntAlias = $int.InterfaceAlias
      IntIP4 = ($int.IPv4Address).ipAddress
      IntDNS = ($int.DNSServer).ServerAddresses
      IntDescr =$int.InterfaceDescription
      }
      
      #Store output in a variable that writes to a debug file along with some other info.
      $str2Write = $str2Write + $arr | Out-String
      }

      This generates a bit of compact output but serves my purpose. But I liked your option as the output it much nicer. I will update my script, thanks again.

      C:\Users\Ratan\desktop> $str2Write
      @{IntID=26; IntAlias=Ethernet 5; IntIP4=169.254.47.26; IntDNS=System.Object[]; IntDescr=N........}
      @{IntID=37; IntAlias=vEthernet (dmz); IntIP4=169.254.37.249; IntDNS=System.Object[]; IntDescr=Hyper-V Virtual .....}
      @{IntID=48; IntAlias=vEthernet (Default Switch) 2; IntIP4=172.17.55.145; IntDNS=System.Object[]; IntDescr=H..........}
      @{IntID=55; IntAlias=vEthernet (nat); IntIP4=172.27.192.1; IntDNS=System.Object[]; IntDescr=H..........}
      @{IntID=8; IntAlias=Wi-Fi; IntIP4=172.16.159.110; IntDNS=4.2.2.1; IntDescr=Intel(R) Dual Band Wireless-AC 8260}
      @{IntID=22; IntAlias=Bluetooth Network Connection 2; IntIP4=169.254.135.17; IntDNS=System.Object[]; IntDescr=Blue.......}
      @{IntID=32; IntAlias=Local Area Connection* 2; IntIP4=169.254.31.155; IntDNS=System.Object[]; IntDescr=Microsoft....}
      @{IntID=11; IntAlias=Local Area Connection* 17; IntIP4=169.254.11.193; IntDNS=System.Object[]; IntDescr=Microsoft .........}
      

      In any case, this is part of a script that I made to dump basic information from a computer to text file which is used for troubleshooting AD, networking and application errors.

      • This reply was modified 1 year, 9 months ago by PowerMe!.
      +1
    • #1554171
      PowerMe!
      Participant
      Member Points: 1,217
      Rank: 3

      Hi Steven,

      What I meant was just a convention I use. For example, when I crate a function with “get-xxx” or “find-xxx” I should be careful enough not to use the nouns already being used. But may be there is a better way to deal with my confusion!

       

      0
    • #1554155
      PowerMe!
      Participant
      Member Points: 1,217
      Rank: 3

      Some time back I was trying to understand AD logon with the help of Wireshark  packet captures. The way I did the lab was as follows.

      1. net stop netlogon
      2. Run Wireshark
      3. net start netlogon

      The following course of events happen.

      1. Host reads the IPConfig and finds out the DNS suffix (e.g., MyDomain.local). It queries the DNS server for that domain.

      2. In particular, it searches for an SRV record in the DNS-query: _ldap._tcp.dc._msdcs.MyDomain.local

      3. The DNS server sends a list of DCs in the domain. In this lab, I have three AD sites, which are listed in the “Answers”.

      4. The host sends LDAP request to a DC from the list. The DC will determine which site the host is in based on the IP subnet. If the host is from a different site, it will advise the host about the nearest DC.

      Once the host in communication with the DC, actual authentication and Kerberos  ticket granting happens.

      Troubleshooting “Slowness” in Authentication:

      1. Process is happening to individuals:

      • 2. I would check the logonserver  (PowerShell $env:logonserver):
      echo %logonserver%
      • 3. I would Pathping/Traceroute the DNS and DC to see if there is a network issue.
      • 4. I would Clear the logon cache
      net stop netlogon
      nltest /dsgetdc:MyDomain.local /force
      net start netlogon
      

      2. Process happening to all hosts in a domain:

      • echo %logonserver% to see if the hosts are authenticating to the DCs in the local network
      • I’d check the network connectivity
      • If multi site, I would check the subset definitions in the ADSites.
      +1
      avatar
    • #1554154
      PowerMe!
      Participant
      Member Points: 1,217
      Rank: 3

      Glad that you fixed it.

      Just a note, I tend not use the “xx-yyy” as function names not confuse with the PowerShell’s verb-noun convention (screenshot).  I try to force myself to be creative with ‘_” or capitalization in naming my function!

      0
Viewing 4 reply threads
© 4sysops 2006 - 2021

CONTACT US

Please ask IT administration questions in the forums. Any other messages are welcome.

Sending

Log in with your credentials

or    

Forgot your details?

Create Account