Monday, December 31, 2012

How-to bulk delete Zendesk users


Situation

After successfully performing a bulk import into Zendesk....I needed to clear out all the accounts.  I had to run this process multiple times as it appears to only return a subset of the users that matched the criteria.

Create text file full of end-users

curl -v -u {email-address}:{password} https://{company}.zendesk.com/api/v2/users/search.json?role="end-user" > zd_end-users.txt

Python script to delete all users in a text file

#!/usr/bin/python
import os
import json

json_data = open('zd_end-users.txt')
data = json.load(json_data)
for user in data['users']:
        os.system("curl -v -u {email-address}:{password} https://{company}.zendesk.com/api/v2/users/%s.json -X DELETE" %user["id"])
json_data.close()


References

http://developer.zendesk.com/documentation/rest_api/introduction.html

Install Windows Server 2012 on vSphere 5

Issue: After the initial reboot when installing Windows Server 2012 the machine stalls with a blue windows and the spinning status balls.

Resolution: http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2021887

How-to bulk import users from AD into Zendesk

How-to bulk import users from AD into Zendesk



PS Y:\> get-aduser -Filter * -SearchBase "ou=employees,ou=accounts,dc=virtualrick,dc=com" -Properties OfficePhone | select Name, UserPrincipalName,OfficePhone | Export-csv c:\employees-accounts-virtualrick.com_2012-11-28.csv