• To connect to Skype For Business Online I have been using:

    Import-Module SkypeOnlineConnector
    
    New-CsOnlineSession -OverrideAdminDomain $AzureDomain -Credential $AZCredential

    Where $AzureDomain is my Azure domain and $AZCredential my Azure admin credential. The OverrideAdminDomain is used as the setup is hybrid.

    This fails for the modern authentication that uses OAuth.

    When I use New-CsOnlineSession it asks me my username (email). But does not authenticate with 403 error (Forbidden). I wonder if any one has been able to use New-CSOnlineSession with MFA

    0
  • Ah, thank you so much, got it.

    0
  • 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.

    C:UsersRatandesktop> $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.

    0
  • I am trying to output basic IP config data for different interfaces on a host by

    Get-NetIPConfiguration | select InterfaceAlias, IPv4Address, DNSServer,IPv4DefaultGateway
    
    or 
    
    Get-NetIPConfiguration | ft -property ("InterfaceAlias", "IPv4Address", "DNSServer","IPv4DefaultGateway")

    It outputs the IP info not in the form I want - just IP addresses. My understanding is that it is outputting the relevant Objects as defined in the Select. I am missing a way to extract the strings from the above objects. Would appreciate an explanation on how to deal with it.

    0
  • PowerMe! liked comment of Michael Pietroforte on PowerShell Remoting over HTTPS with a self-signed SSL certificate. (So far, Michael Pietroforte has 1 likes for this comment.) 6 months, 2 weeks ago

    0
  • Enter-PSSession : Connecting to remote server serv19 failed with the following error message : The server certificate on the destination computer (serv19:5986) has the following errors:    
    
    The SSL certificate is signed by an unknown certificate authority. For more information, see the about_Remote_Troubleshooting Help topic.
    
    At line:1 char:1
    
    + Enter-PSSession -ComputerName $myhost -Credential $cred -UseSSL
    
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
        + CategoryInfo          : InvalidArgument: (serv19:String) [Enter-PSSession], PSRemotingTransportException
    
        + FullyQualifiedErrorId : CreateRemoteRunspaceFailed
    0
  • Nicely summarized. 

    Certificate based- SSL or SSH - not only encrypt data but also protect the identities of the 2 hosts involved in WinRM - little room for a Man-in-the-Middle attack.

    0
  • PowerMe! liked comment of Michael Pietroforte on Invoke-Command: Dealing with offline computers. (So far, Michael Pietroforte has 1 likes for this comment.) 6 months, 2 weeks ago

    0
  • PowerMe! liked comment of Michael Pietroforte on Invoke-Command: Dealing with offline computers. (So far, Michael Pietroforte has 1 likes for this comment.) 6 months, 2 weeks ago

    0
  • I did a lab to understand PS-Remoting. Michael has an interesting article on the latter.

    • I used a Windows Server 2019 as my target and Windows 10 as the source of PS-Remoting.
    • They are WorkGroup hosts (no Domain).
    • I have tested both HTTP and HTTPS methods with the following script where I changed the port number to 5985 for HTTP.
    $myhost = 'winS19'
    $winrmPort = '5986'
    $cred = $null
    $cred = Get-Credential -UserName Administrator -Message "Provide Password"
    
    if(Test-NetConnection $myhost -port $winrmPort){
    
        $sessOptions = New-PSSessionOption -SkipCACheck
        $sess = New-PSSession -ComputerName $myhost -UseSSL -Credential $cred -SessionOption $sessOptions
        Enter-PSSession $sess
        }
    

    Encryption in PS-Remoting

    1. In both the cases- HTTP and HTTPS- the PS-Remoting traffic are encrypted.
    2. Encryption in HTTP is provided by NTLM Security Support Provider (NTLMSSP) which I think uses 128 bit encryption with Challenges. I was reading about encryption in HTTP based PS-Remoting. In a domain-environment it uses Kerberos, otherwise (workgroup) it uses NTLMSSP.
    3. HTTPS based PS-Remoting uses TLS1.2 with much secure encryption (AES 256, SHA 384 ...) 
    4. Considering the vulnerabilities with NTLM, I would be more inclined towards HTTPS and remove an HTTP option as suggested by the article from Michael.

    I took packet captures in Wireshark. I have some screenshots that I can add to the post if useful.

    0
  • PowerMe! liked comment of Michael Pietroforte on Invoke-Command: Dealing with offline computers. (So far, Michael Pietroforte has 2 likes for this comment.) 6 months, 2 weeks ago

    0
  • Thank you for the article. I was stuck with winrm quickconfig -transport:HTTPs. But this was big rescue! However I had an issue with the self-signed cert as the Enter-PSSession kept complaining about the self-signed nature of the cert.

    I came up with the using a session option.

    $myhost = 'serv19'
    
    $winrmPort = '5986'
    
    if(Test-NetConnection $myhost -port $winrmPort){
    
    $sessOptions = New-PSSessionOption -SkipCACheck
    
    Enter-PSSession -ComputerName $myhost -UseSSL -Credential Administrator -SessionOption $sessOptions
    
    }
    0
  • PowerMe! liked comment of Jeff Hicks on Invoke-Command: Dealing with offline computers. (So far, Jeff Hicks has 1 likes for this comment.) 6 months, 2 weeks ago

    0
  • Thank you Mike.

    I was reading about the TCP ports used PoweShell remoting. PS-remoting uses HTTP and/or HTTPs. The common ports being TCP 80 and TCP 443, respectively.

    It seems like, due to security concerns, these ports have been moved to TCP 5985 (HTTP) and 5986 (HTTPs). Also note that if you'd like to use IIS 80 and 443 must be available. The above is an interesting article on the port-security. I prefer -useSSL as HTTP is plain-text.

    0
  • PowerMe! liked comment of Jeff Hicks on Invoke-Command: Dealing with offline computers. (So far, Jeff Hicks has 2 likes for this comment.) 6 months, 2 weeks ago

    0
  • 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
  • Load More