Forum Replies Created

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

      Ah, thank you so much, got it.

    • #1554420
      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?


      @{…} 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=; IntDNS=System.Object[]; IntDescr=N........}
      @{IntID=37; IntAlias=vEthernet (dmz); IntIP4=; IntDNS=System.Object[]; IntDescr=Hyper-V Virtual .....}
      @{IntID=48; IntAlias=vEthernet (Default Switch) 2; IntIP4=; IntDNS=System.Object[]; IntDescr=H..........}
      @{IntID=55; IntAlias=vEthernet (nat); IntIP4=; IntDNS=System.Object[]; IntDescr=H..........}
      @{IntID=8; IntAlias=Wi-Fi; IntIP4=; IntDNS=; IntDescr=Intel(R) Dual Band Wireless-AC 8260}
      @{IntID=22; IntAlias=Bluetooth Network Connection 2; IntIP4=; IntDNS=System.Object[]; IntDescr=Blue.......}
      @{IntID=32; IntAlias=Local Area Connection* 2; IntIP4=; IntDNS=System.Object[]; IntDescr=Microsoft....}
      @{IntID=11; IntAlias=Local Area Connection* 17; IntIP4=; 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!.
    • #1554171
      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!


    • #1554155
      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.
    • #1554154
      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!

Viewing 4 reply threads
© 4sysops 2006 - 2021


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


Log in with your credentials


Forgot your details?

Create Account