SOLVED

Hide Connection Established message with Connect-AzureAD

%3CLINGO-SUB%20id%3D%22lingo-sub-3115761%22%20slang%3D%22en-US%22%3EHide%20Connection%20Established%20message%20with%20Connect-AzureAD%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3115761%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20there%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ein%20my%20script%20i%20am%20writing%20%22connect-AzureAD%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20asks%20for%20me%20a%20authentication.%20Once%20authentication%20completes%2C%20it%20shows%20me%20a%20message%20like%20below%20with%20my%20details.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAccount%20Environment%20TenantId%20TenantDomain%20AccountType%3CBR%20%2F%3E-------%20-----------%20--------%20------------%20-----------%3C%2FP%3E%3CP%3Exxxxxx%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20xxxxx%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20xxxxxxx%26nbsp%3B%20%26nbsp%3B%20xxxx%26nbsp%3B%20%26nbsp%3B%20xxxx%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ei%20would%20like%20to%20hide%20this%20from%20my%20script%20output.%20Is%20that%20possible%20%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3115761%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%20Active%20Directory%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3115871%22%20slang%3D%22en-US%22%3ERe%3A%20Hide%20Connection%20Established%20message%20with%20Connect-AzureAD%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3115871%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F930361%22%20target%3D%22_blank%22%3E%40venka91%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20can%20use%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3E%24null%20%3D%20connect-AzureAD%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3Eif%20you%20want%20to%20dispose%20of%20the%20output%20from%20the%20connection%20or%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3E%24var%20%3D%20connect-AzureAD%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3Bif%20you%20want%20to%20have%20the%20output%20available%20for%20later%20processing%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Hi there,

 

in my script i am writing "connect-AzureAD"

 

This asks for me a authentication. Once authentication completes, it shows me a message like below with my details.

 

Account Environment TenantId TenantDomain AccountType
------- ----------- -------- ------------ -----------

xxxxxx      xxxxx        xxxxxxx    xxxx    xxxx

 

i would like to hide this from my script output. Is that possible ?

2 Replies
best response confirmed by venka91 (Occasional Contributor)
Solution

@venka91 

You can use 

$null = connect-AzureAD

if you want to dispose of the output from the connection or

$var = connect-AzureAD

 if you want to have the output available for later processing

@Jonathan_Allen 

 

Thank you so much. This is worked great.