SOLVED

How to connect multiple VMs of multiple regions to an OMS workspace.

%3CLINGO-SUB%20id%3D%22lingo-sub-729526%22%20slang%3D%22en-US%22%3EHow%20to%20connect%20multiple%20VMs%20of%20multiple%20regions%20to%20an%20OMS%20workspace.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-729526%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20multiple%20virtual%20machines%20in%20multiple%20regions%20or%20different%20resource%20groups.%20so%20how%20to%20connect%20all%20the%20VMS%20into%20the%20OMS%20workgroup.%20it%20is%20possible%20to%20connect%20all%20VMS%20using%20a%20PowerShell%20script%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-729526%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EApp%20Services%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EAzure%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMonitoring%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-729569%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20connect%20multiple%20VMs%20of%20multiple%20regions%20to%20an%20OMS%20workspace.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-729569%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F141516%22%20target%3D%22_blank%22%3E%40Prashant%20Sharma%3C%2FA%3EA%20computer%20in%20any%20region%2C%20subscription%2C%20on-premises%20or%20other%20cloud%20provider%20can%20send%20data%20to%20a%20workspace.%26nbsp%3B%20For%20an%20Azure%20VM%2C%20go%20into%20the%20workspace%20you%20want%20them%20to%20connect%20to%20and%20Virtual%20Machines%20under%20Workspace%20Data%20Sources.%26nbsp%3B%20Select%20the%20VM%20and%20connect.%20%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20did%20a%20series%20of%20videos%20on%20Log%20Analytics.%26nbsp%3B%20I%20cover%20the%20information%20above%20as%20well%20as%20how%20to%20setup%20Azure%20and%20Non-Azure%20servers.%20%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fwww.youtube.com%2Fplaylist%3Flist%3DPLnWpsLZNgHzVXXyN9a0jm9xNNDrikHf8I%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.youtube.com%2Fplaylist%3Flist%3DPLnWpsLZNgHzVXXyN9a0jm9xNNDrikHf8I%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-729649%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20connect%20multiple%20VMs%20of%20multiple%20regions%20to%20an%20OMS%20workspace.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-729649%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F78468%22%20target%3D%22_blank%22%3E%40Travis%20Roberts%3C%2FA%3E%26nbsp%3B%20thank%20you%20for%20this%20Travis.%20but%20I%20can%20not%20connect%20the%20single-single%20VM%20to%20the%20workspace.%3C%2FP%3E%3CP%3EI%20need%20a%20script%20(PowerShell%20script).%20so%20i%20can%20fill%20the%20VM%20name%20and%20resource%20group%20into%20the%20excel%20sheet%20and%20run%20that%20Excel%20sheet%20through%20the%20PowerShell%20script.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-729776%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20connect%20multiple%20VMs%20of%20multiple%20regions%20to%20an%20OMS%20workspace.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-729776%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F141516%22%20target%3D%22_blank%22%3E%40Prashant%20Sharma%3C%2FA%3E%26nbsp%3BBelow%20is%20a%20link%20to%20the%20command%20line%20setup.%26nbsp%3B%20Possibly%20use%20this%20with%20Invoke-Command%3F%26nbsp%3B%20Another%20Azure%20option%20would%20be%20to%20used%20a%20custom%20script%20extension%20to%20push%20the%20settings.%26nbsp%3B%20DSC%20would%20also%20be%20an%20option.%26nbsp%3B%20Best%20bet%20would%20be%20to%20push%20it%20out%20with%20SCCM%20or%20some%20other%20application%20deployment%20solution.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFWIW%2C%20OMS%20settings%20can%20be%20deployed%20as%20part%20of%20an%20ARM%20template.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fazure-monitor%2Fplatform%2Fagent-windows%23install-the-agent-using-the-command-line%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fazure-monitor%2Fplatform%2Fagent-windows%23install-the-agent-using-the-command-line%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Contributor

I have multiple virtual machines in multiple regions or different resource groups. so how to connect all the VMS into the OMS workgroup. it is possible to connect all VMS using a PowerShell script?

 

3 Replies

@Prashant SharmaA computer in any region, subscription, on-premises or other cloud provider can send data to a workspace.  For an Azure VM, go into the workspace you want them to connect to and Virtual Machines under Workspace Data Sources.  Select the VM and connect.  

 

I did a series of videos on Log Analytics.  I cover the information above as well as how to setup Azure and Non-Azure servers.  https://www.youtube.com/playlist?list=PLnWpsLZNgHzVXXyN9a0jm9xNNDrikHf8I

Share your videos with friends, family, and the world
best response confirmed by Prashant Sharma (Contributor)
Solution

@Travis Roberts  thank you for this Travis. but I can not connect the single-single VM to the workspace.

I need a script (PowerShell script). so i can fill the VM name and resource group into the excel sheet and run that Excel sheet through the PowerShell script.

@Prashant Sharma Below is a link to the command line setup.  Possibly use this with Invoke-Command?  Another Azure option would be to used a custom script extension to push the settings.  DSC would also be an option.  Best bet would be to push it out with SCCM or some other application deployment solution.

 

FWIW, OMS settings can be deployed as part of an ARM template.

 

https://docs.microsoft.com/en-us/azure/azure-monitor/platform/agent-windows#install-the-agent-using-...