Hi,
i am having a nasty problem and i was not able to find out why.
So here is my situation:
I am doing that on Powershell 5 because i need some information about my AD.
So i am creating a variable with some informations about the AD.
$i = Get-ADUser -Filter * useraccountcontrol | Select-Object Surname,GivenName,userAccountControl | Sort-Object -Property GivenName
Output:
Surname GivenName userAccountControl
------------ ---------------- --------------------------
User1 BLABLA 1234
User2 BLABLA 5678
You get the idea.
Then i Convert it to an JSON:
$i = $i | ConvertTo-Json -Compress
Output is and correct JSON Format:
[{"Surname":"User1","GivenName":"BLABLA","userAc cou ntControl":1234},{"Surname":"User2","GivenName":"B LABLA","userAccountControl":5678}]
Now i would like to send it in that format to the Zabbix Server via the Zabbix_Sender.exe
C:\zabbix\zabbix_sender.exe -s Domain -c C:\zabbix\zabbix_agentd.conf -k ad.user -o $i
Zabbix recieves:
[{Surname:User1,GivenName:BLABLA,userAccountControl :1234},{Surname:User2,GivenName:BLABLA,userAccount Control:5678}]
Thats no JSON anymore. And Zabbix cannot interprate that and i don't know why.
Am I doing something wrong?
Please help me i am getting rather desperate.
Many Thanks
Tom
i am having a nasty problem and i was not able to find out why.
So here is my situation:
I am doing that on Powershell 5 because i need some information about my AD.
So i am creating a variable with some informations about the AD.
$i = Get-ADUser -Filter * useraccountcontrol | Select-Object Surname,GivenName,userAccountControl | Sort-Object -Property GivenName
Output:
Surname GivenName userAccountControl
------------ ---------------- --------------------------
User1 BLABLA 1234
User2 BLABLA 5678
You get the idea.
Then i Convert it to an JSON:
$i = $i | ConvertTo-Json -Compress
Output is and correct JSON Format:
[{"Surname":"User1","GivenName":"BLABLA","userAc cou ntControl":1234},{"Surname":"User2","GivenName":"B LABLA","userAccountControl":5678}]
Now i would like to send it in that format to the Zabbix Server via the Zabbix_Sender.exe
C:\zabbix\zabbix_sender.exe -s Domain -c C:\zabbix\zabbix_agentd.conf -k ad.user -o $i
Zabbix recieves:
[{Surname:User1,GivenName:BLABLA,userAccountControl :1234},{Surname:User2,GivenName:BLABLA,userAccount Control:5678}]
Thats no JSON anymore. And Zabbix cannot interprate that and i don't know why.
Am I doing something wrong?
Please help me i am getting rather desperate.
Many Thanks
Tom
Comment