Sub test()
Dim tbl(1 To 1000, 1 To 8)
Dim Computer, ServiceSet, Service
Computer = "."
Set ServiceSet = GetObject("winmgmts:{impersonationLevel=impersonate}!//./root/cimv2").InstancesOf("Win32_Service")
For Each Service In ServiceSet
a = a + 1
tbl(a, 1) = Service.DisplayName
Next
Set ServiceSet = Nothing
Cells(1, 1).Resize(a) = tbl
End Sub
Get-Service | Where-Object {$_.Status -eq "Running"} | Out-File -filepath "$Env:userprofile\Desktop\ServicesActifs.txt"