[{"data":1,"prerenderedAt":715},["ShallowReactive",2],{"post:\u002F2015\u002F02\u002F06\u002Fpowershell-autotask-get-picklist-values\u002F":3},{"post":4,"newer":665,"older":674,"related":684,"series":713},{"id":5,"title":6,"body":7,"canonical":643,"categories":644,"date":647,"description":648,"extension":649,"featured":650,"hero":651,"image":651,"meta":652,"navigation":406,"path":653,"readingTime":174,"seo":654,"series":651,"seriesOrder":651,"sites":655,"source":657,"stem":658,"tags":659,"updated":662,"url":663,"__hash__":664},"blog\u002Fblog\u002F2015\u002F02\u002F06\u002Fpowershell-autotask-get-picklist-values.md","PowerShell: Autotask – Get Picklist Values",{"type":8,"value":9,"toc":637},"minimark",[10,14,17,22,48,52,55,154,158,161,182,196,202,226,230,633],[11,12,13],"p",{},"When using Autotask’s API it’s required to lookup a various amount of picklist values that are used in updating your web request. This is a PowerShell way to pull those picklist values. The first part of the script validates your AT URI, the second part gets the entity data, in this case I was looking for “ticket” related fields.",[11,15,16],{},"Edit: Updated to give a more friendly output",[18,19,21],"h2",{"id":20},"requirements","Requirements",[23,24,25,34,37],"ul",{},[26,27,28,29,33],"li",{},"Windows PowerShell 2.0 or later. ",[30,31,32],"code",{},"New-WebServiceProxy"," is not available in PowerShell 6 and later.",[26,35,36],{},"An Autotask user with API access (username and password).",[26,38,39,40,43,44,47],{},"HTTPS access to the Autotask web services (",[30,41,42],{},"webservices1.autotask.net"," and the zone URL that ",[30,45,46],{},"getZoneInfo"," returns).",[18,49,51],{"id":50},"parameters","Parameters",[11,53,54],{},"The script takes no parameters. Edit these values before running it.",[56,57,58,77],"table",{},[59,60,61],"thead",{},[62,63,64,68,71,74],"tr",{},[65,66,67],"th",{},"Name",[65,69,70],{},"Type",[65,72,73],{},"Required",[65,75,76],{},"Description",[78,79,80,100,118,135],"tbody",{},[62,81,82,88,91,94],{},[83,84,85],"td",{},[30,86,87],{},"$ATurl",[83,89,90],{},"String",[83,92,93],{},"Yes",[83,95,96,97,99],{},"Starting WSDL used to look up your zone. It is replaced with the zone URL that ",[30,98,46],{}," returns.",[62,101,102,107,109,111],{},[83,103,104],{},[30,105,106],{},"$ATusername",[83,108,90],{},[83,110,93],{},[83,112,113,114,117],{},"Autotask API username. Replace ",[30,115,116],{},"\u003Cautotask-username>",".",[62,119,120,125,127,129],{},[83,121,122],{},[30,123,124],{},"$ATpassword",[83,126,90],{},[83,128,93],{},[83,130,131,132,117],{},"Password for that user. Replace ",[30,133,134],{},"\u003Cautotask-password>",[62,136,137,142,144,147],{},[83,138,139],{},[30,140,141],{},"\"Ticket\"",[83,143,90],{},[83,145,146],{},"No",[83,148,149,150,153],{},"Entity passed to ",[30,151,152],{},"getFieldInfo",". Change it to list the picklists of another entity.",[18,155,157],{"id":156},"usage","Usage",[11,159,160],{},"Fill in the username and password, then run the script.",[162,163,168],"pre",{"className":164,"code":165,"language":166,"meta":167,"style":167},"language-powershell shiki shiki-themes github-light",".\\Get-AutotaskPicklistValues.ps1\n","powershell","",[30,169,170],{"__ignoreMap":167},[171,172,175,178],"span",{"class":173,"line":174},"line",1,[171,176,117],{"class":177},"sgsFI",[171,179,181],{"class":180},"sYu0t","\\Get-AutotaskPicklistValues.ps1\n",[11,183,184,185,188,189,188,192,195],{},"For each field in the entity it prints the name, label and description, followed by the picklist values (",[30,186,187],{},"Label",", ",[30,190,191],{},"Value",[30,193,194],{},"IsActive","). It ends with your API threshold and usage message.",[11,197,198,199,201],{},"To look at another entity, change the entity name in the ",[30,200,152],{}," call.",[162,203,205],{"className":164,"code":204,"language":166,"meta":167,"style":167},"$entity = $atws.getFieldInfo(\"Account\")\n",[30,206,207],{"__ignoreMap":167},[171,208,209,212,216,219,223],{"class":173,"line":174},[171,210,211],{"class":177},"$entity ",[171,213,215],{"class":214},"sD7c4","=",[171,217,218],{"class":177}," $atws.getFieldInfo(",[171,220,222],{"class":221},"sYBdl","\"Account\"",[171,224,225],{"class":177},")\n",[18,227,229],{"id":228},"script","Script",[162,231,233],{"className":164,"code":232,"language":166,"meta":167,"style":167},"\u003C#\n.SYNOPSIS\n    Lists the picklist values for an Autotask entity (Ticket by default) through the Autotask SOAP API.\n.DESCRIPTION\n    Connects to the Autotask web service with the given credentials, looks up the zone for the user\n    and reconnects to the zone WSDL. It then calls getFieldInfo for the Ticket entity and prints each\n    field with its picklist values, and finishes by printing the API threshold and usage message.\n.EXAMPLE\n    .\\Get-AutotaskPicklistValues.ps1\n.NOTES\n    Author  : Thomas Lasswell (https:\u002F\u002Fwww.techcolumnist.com)\n    Version : 1.0 (2015-02-06)\n    Requires: Windows PowerShell 2.0+ (New-WebServiceProxy), an Autotask API user\n#>\n# Username and password for Autotask.\n$ATurl = \"https:\u002F\u002Fwebservices1.autotask.net\u002Fatservices\u002F1.5\u002Fatws.wsdl\"\n$ATusername = \"\u003Cautotask-username>\"\n$ATpassword = ConvertTo-SecureString \"\u003Cautotask-password>\" -AsPlainText -Force\n$ATcredentials = New-Object System.Management.Automation.PSCredential($ATusername, $ATpassword)\n\n# Look up the zone for this user and connect to it.\n$atws = New-WebServiceProxy -Uri $ATurl -Credential $ATcredentials\n$zoneInfo = $atws.getZoneInfo($ATusername)\n$ATurl = $zoneInfo.URL.Replace(\".asmx\", \".wsdl\")\n$atws = New-WebServiceProxy -Uri $ATurl -Credential $ATcredentials\n\n# Get the field information for the entity.\n$entity = $atws.getFieldInfo(\"Ticket\")\n\nforeach ($picklist in $entity) {\n    $picklist | Select-Object Name, Label, Description | Format-Table\n    foreach ($values in $picklist.PicklistValues) {\n        $values | Select-Object Label, Value, IsActive\n    }\n}\n\n# Show the API threshold and usage information.\n$output = $atws.getThresholdAndUsageInfo()\n$output.EntityReturnInfoResults.message\n",[30,234,235,241,249,255,263,269,275,281,289,295,303,309,315,321,327,333,344,355,381,401,408,414,435,446,466,483,488,494,507,512,527,557,571,593,599,605,610,616,627],{"__ignoreMap":167},[171,236,237],{"class":173,"line":174},[171,238,240],{"class":239},"sAwPA","\u003C#\n",[171,242,244,246],{"class":173,"line":243},2,[171,245,117],{"class":180},[171,247,248],{"class":214},"SYNOPSIS\n",[171,250,252],{"class":173,"line":251},3,[171,253,254],{"class":239},"    Lists the picklist values for an Autotask entity (Ticket by default) through the Autotask SOAP API.\n",[171,256,258,260],{"class":173,"line":257},4,[171,259,117],{"class":180},[171,261,262],{"class":214},"DESCRIPTION\n",[171,264,266],{"class":173,"line":265},5,[171,267,268],{"class":239},"    Connects to the Autotask web service with the given credentials, looks up the zone for the user\n",[171,270,272],{"class":173,"line":271},6,[171,273,274],{"class":239},"    and reconnects to the zone WSDL. It then calls getFieldInfo for the Ticket entity and prints each\n",[171,276,278],{"class":173,"line":277},7,[171,279,280],{"class":239},"    field with its picklist values, and finishes by printing the API threshold and usage message.\n",[171,282,284,286],{"class":173,"line":283},8,[171,285,117],{"class":180},[171,287,288],{"class":214},"EXAMPLE\n",[171,290,292],{"class":173,"line":291},9,[171,293,294],{"class":239},"    .\\Get-AutotaskPicklistValues.ps1\n",[171,296,298,300],{"class":173,"line":297},10,[171,299,117],{"class":180},[171,301,302],{"class":214},"NOTES\n",[171,304,306],{"class":173,"line":305},11,[171,307,308],{"class":239},"    Author  : Thomas Lasswell (https:\u002F\u002Fwww.techcolumnist.com)\n",[171,310,312],{"class":173,"line":311},12,[171,313,314],{"class":239},"    Version : 1.0 (2015-02-06)\n",[171,316,318],{"class":173,"line":317},13,[171,319,320],{"class":239},"    Requires: Windows PowerShell 2.0+ (New-WebServiceProxy), an Autotask API user\n",[171,322,324],{"class":173,"line":323},14,[171,325,326],{"class":239},"#>\n",[171,328,330],{"class":173,"line":329},15,[171,331,332],{"class":239},"# Username and password for Autotask.\n",[171,334,336,339,341],{"class":173,"line":335},16,[171,337,338],{"class":177},"$ATurl ",[171,340,215],{"class":214},[171,342,343],{"class":221}," \"https:\u002F\u002Fwebservices1.autotask.net\u002Fatservices\u002F1.5\u002Fatws.wsdl\"\n",[171,345,347,350,352],{"class":173,"line":346},17,[171,348,349],{"class":177},"$ATusername ",[171,351,215],{"class":214},[171,353,354],{"class":221}," \"\u003Cautotask-username>\"\n",[171,356,358,361,363,366,369,372,375,378],{"class":173,"line":357},18,[171,359,360],{"class":177},"$ATpassword ",[171,362,215],{"class":214},[171,364,365],{"class":180}," ConvertTo-SecureString",[171,367,368],{"class":221}," \"\u003Cautotask-password>\"",[171,370,371],{"class":214}," -",[171,373,374],{"class":177},"AsPlainText ",[171,376,377],{"class":214},"-",[171,379,380],{"class":177},"Force\n",[171,382,384,387,389,392,395,398],{"class":173,"line":383},19,[171,385,386],{"class":177},"$ATcredentials ",[171,388,215],{"class":214},[171,390,391],{"class":180}," New-Object",[171,393,394],{"class":177}," System.Management.Automation.PSCredential($ATusername",[171,396,397],{"class":214},",",[171,399,400],{"class":177}," $ATpassword)\n",[171,402,404],{"class":173,"line":403},20,[171,405,407],{"emptyLinePlaceholder":406},true,"\n",[171,409,411],{"class":173,"line":410},21,[171,412,413],{"class":239},"# Look up the zone for this user and connect to it.\n",[171,415,417,420,422,425,427,430,432],{"class":173,"line":416},22,[171,418,419],{"class":177},"$atws ",[171,421,215],{"class":214},[171,423,424],{"class":180}," New-WebServiceProxy",[171,426,371],{"class":214},[171,428,429],{"class":177},"Uri $ATurl ",[171,431,377],{"class":214},[171,433,434],{"class":177},"Credential $ATcredentials\n",[171,436,438,441,443],{"class":173,"line":437},23,[171,439,440],{"class":177},"$zoneInfo ",[171,442,215],{"class":214},[171,444,445],{"class":177}," $atws.getZoneInfo($ATusername)\n",[171,447,449,451,453,456,459,461,464],{"class":173,"line":448},24,[171,450,338],{"class":177},[171,452,215],{"class":214},[171,454,455],{"class":177}," $zoneInfo.URL.Replace(",[171,457,458],{"class":221},"\".asmx\"",[171,460,397],{"class":214},[171,462,463],{"class":221}," \".wsdl\"",[171,465,225],{"class":177},[171,467,469,471,473,475,477,479,481],{"class":173,"line":468},25,[171,470,419],{"class":177},[171,472,215],{"class":214},[171,474,424],{"class":180},[171,476,371],{"class":214},[171,478,429],{"class":177},[171,480,377],{"class":214},[171,482,434],{"class":177},[171,484,486],{"class":173,"line":485},26,[171,487,407],{"emptyLinePlaceholder":406},[171,489,491],{"class":173,"line":490},27,[171,492,493],{"class":239},"# Get the field information for the entity.\n",[171,495,497,499,501,503,505],{"class":173,"line":496},28,[171,498,211],{"class":177},[171,500,215],{"class":214},[171,502,218],{"class":177},[171,504,141],{"class":221},[171,506,225],{"class":177},[171,508,510],{"class":173,"line":509},29,[171,511,407],{"emptyLinePlaceholder":406},[171,513,515,518,521,524],{"class":173,"line":514},30,[171,516,517],{"class":214},"foreach",[171,519,520],{"class":177}," ($picklist ",[171,522,523],{"class":214},"in",[171,525,526],{"class":177}," $entity) {\n",[171,528,530,533,536,539,542,544,547,549,552,554],{"class":173,"line":529},31,[171,531,532],{"class":177},"    $picklist ",[171,534,535],{"class":214},"|",[171,537,538],{"class":180}," Select-Object",[171,540,541],{"class":177}," Name",[171,543,397],{"class":214},[171,545,546],{"class":177}," Label",[171,548,397],{"class":214},[171,550,551],{"class":177}," Description ",[171,553,535],{"class":214},[171,555,556],{"class":180}," Format-Table\n",[171,558,560,563,566,568],{"class":173,"line":559},32,[171,561,562],{"class":214},"    foreach",[171,564,565],{"class":177}," ($values ",[171,567,523],{"class":214},[171,569,570],{"class":177}," $picklist.PicklistValues) {\n",[171,572,574,577,579,581,583,585,588,590],{"class":173,"line":573},33,[171,575,576],{"class":177},"        $values ",[171,578,535],{"class":214},[171,580,538],{"class":180},[171,582,546],{"class":177},[171,584,397],{"class":214},[171,586,587],{"class":177}," Value",[171,589,397],{"class":214},[171,591,592],{"class":177}," IsActive\n",[171,594,596],{"class":173,"line":595},34,[171,597,598],{"class":177},"    }\n",[171,600,602],{"class":173,"line":601},35,[171,603,604],{"class":177},"}\n",[171,606,608],{"class":173,"line":607},36,[171,609,407],{"emptyLinePlaceholder":406},[171,611,613],{"class":173,"line":612},37,[171,614,615],{"class":239},"# Show the API threshold and usage information.\n",[171,617,619,622,624],{"class":173,"line":618},38,[171,620,621],{"class":177},"$output ",[171,623,215],{"class":214},[171,625,626],{"class":177}," $atws.getThresholdAndUsageInfo()\n",[171,628,630],{"class":173,"line":629},39,[171,631,632],{"class":177},"$output.EntityReturnInfoResults.message\n",[634,635,636],"style",{},"html pre.shiki code .sgsFI, html code.shiki .sgsFI{--shiki-default:#24292E}html pre.shiki code .sYu0t, html code.shiki .sYu0t{--shiki-default:#005CC5}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .sD7c4, html code.shiki .sD7c4{--shiki-default:#D73A49}html pre.shiki code .sYBdl, html code.shiki .sYBdl{--shiki-default:#032F62}html pre.shiki code .sAwPA, html code.shiki .sAwPA{--shiki-default:#6A737D}",{"title":167,"searchDepth":243,"depth":243,"links":638},[639,640,641,642],{"id":20,"depth":243,"text":21},{"id":50,"depth":243,"text":51},{"id":156,"depth":243,"text":157},{"id":228,"depth":243,"text":229},"techcolumnist",[645,646],"ps","scripts","2015-02-06T18:11:32Z","When using AutoTask’s API it’s required to lookup a various amount of picklist values that are used in updating you’re web request.","md",false,null,{},"\u002Fblog\u002F2015\u002F02\u002F06\u002Fpowershell-autotask-get-picklist-values",{"title":6,"description":648},[656,643],"lasswell","both","blog\u002F2015\u002F02\u002F06\u002Fpowershell-autotask-get-picklist-values",[660,166,661],"autotask","soap","2026-09-20T00:00:00Z","\u002F2015\u002F02\u002F06\u002Fpowershell-autotask-get-picklist-values\u002F","-k4_6WETwuyYugUDtM3ZO_bNZBHdKMQHfkFZR8nFejE",{"title":666,"description":667,"date":668,"url":669,"categories":670,"tags":671,"image":651,"readingTime":174,"canonical":643,"sites":673,"series":651,"seriesOrder":651},"PowerShell: Connect to LogicMonitor’s REST API","It’s been a while since I’ve posted. Way too long. I’ve had this script for quite a while that I wanted to share with the world.","2016-02-22T20:53:26Z","\u002F2016\u002F02\u002F22\u002Fpowershell-connect-to-logicmonitors-rest-api\u002F",[645,646],[672,166],"logicmonitor",[656,643],{"title":675,"description":676,"date":677,"url":678,"categories":679,"tags":681,"image":651,"readingTime":174,"canonical":643,"sites":683,"series":651,"seriesOrder":651},"PowerShell: NetApp – Gather Volume Information","This is a simple script to gather volume information including dedupe schedule and autogrow settings.","2014-04-28T12:57:58Z","\u002F2014\u002F04\u002F28\u002Fpowershell-netapp-gather-volume-information\u002F",[680,645,646],"dotps",[682,166,228],"netapp",[656,643],[685,693,703],{"title":686,"description":687,"date":688,"url":689,"categories":690,"tags":691,"image":651,"readingTime":174,"canonical":643,"sites":692,"series":651,"seriesOrder":651},"PowerShell: Autotask – Enable Client Portal for All Users","This is a quick one, it’s been forever since I’ve posted here. After moving back to Autotask, there’s still a ton of things to automate.","2022-10-12T14:13:37Z","\u002F2022\u002F10\u002F12\u002Fautotask-powershell-enable-client-portal-for-all-users\u002F",[645,646],[660,166],[656,643],{"title":694,"description":695,"date":696,"url":697,"categories":698,"tags":699,"image":651,"readingTime":174,"canonical":643,"sites":702,"series":651,"seriesOrder":651},"PowerShell: Get Exchange Mailboxes Over XXGB","Simple command turned crazy. I ended up coming up with this due to the fact we have duplicate display names and needed to update for Exchange Online to get mailbox sizes.","2021-02-18T14:46:29Z","\u002F2021\u002F02\u002F18\u002Fpowershell-get-exchange-mailboxes-over-xxgb\u002F",[645,646],[166,700,701],"exchange","exchange-online",[656,643],{"title":704,"description":705,"date":706,"url":707,"categories":708,"tags":709,"image":711,"readingTime":243,"canonical":643,"sites":712,"series":651,"seriesOrder":651},"PowerShell: ConnectWise Documents API, Uploading a Document or Attachment to a Ticket","PowerShell: upload a document or attachment to a ConnectWise ticket through the form-based Documents API.","2019-01-09T09:46:57Z","\u002F2019\u002F01\u002F09\u002Fpowershell-connectwise-documents-api-uploading-a-document-or-attachment-to-a-ticket\u002F",[645,646],[710,166],"connectwise","\u002Fuploads\u002F2019\u002F01\u002Fimage.png",[656,643],{"doc":651,"posts":714},[],1789970954410]