-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMySampleConfig.ps1
50 lines (39 loc) · 1.51 KB
/
MySampleConfig.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
Configuration MySampleConfig {
$OIPackageLocalPath = "C:\MMASetup-AMD64.exe"
Import-DscResource -ModuleName xPSDesiredStateConfiguration
Node "managedwebserver" {
#Ensure that IIS is present
WindowsFeature IIS {
Ensure="Present"
Name= "Web-Server"
}
#Create two files and validate the content of the files
File MyFile {
DestinationPath = "C:\MyFile.txt"
Contents = "Hello MMS"
}
File MyOtherFile {
DestinationPath = "C:\MyOtherFile.txt"
Contents = "Goodbye MMS"
}
#Validate that MMA Agent is installed, running & sending data to Log Analytics
Service OIService
{
Name = "HealthService"
State = "Running"
}
xRemoteFile OIPackage {
Uri = "https://opsinsight.blob.core.windows.net/publicfiles/MMASetup-AMD64.exe"
DestinationPath = $OIPackageLocalPath
}
Package OI {
Ensure = "Present"
Path = $OIPackageLocalPath
Name = "Microsoft Monitoring Agent"
ProductId = ""
Arguments = '/C:"setup.exe /qn ADD_OPINSIGHTS_WORKSPACE=1 OPINSIGHTS_WORKSPACE_ID=0003933f-b5ab-4ac2-bafd-8bf588f88122 OPINSIGHTS_WORKSPACE_KEY=VZIb0JtqjLAVWizEcLqbGO+x0oK8poendQzy5SWdo466PEUvelBObwtLTtGcnogAqZ/C9ZuNbDuctQ4LRa1fdw== AcceptEndUserLicenseAgreement=1"'
DependsOn = "[xRemoteFile]OIPackage"
}
}
}