Thursday, February 9, 2012

Axosoft OnTime get a list of all contact with company name, email, phone using Axosoft OnTime SDK and Powershell


clear

$securityToken="your guid here"

$customerUrl="http://[your url here]/ontimesdk/customerservice.asmx"

$onTimeCustomer = New-WebServiceProxy $customerUrl -Namespace customers

$customerHandler = New-Object customers.CustomerHandler

$dataset2 = $customerHandler.GetAllCustomerContacts($securityToken)

foreach ($contactRow in $dataset2.Tables[0].Rows)
{
if ($contactRow.CanLogin)
{
$contactRow.CompanyName
" " + $contactRow.FirstName + " " + $contactRow.LastName
" " + $contactRow.Email + " " + $contactRow.Phone
" "
}
}

Wednesday, February 8, 2012

Axosoft Ontime Getting all projects using Powershell and Axosoft Ontime SDK


clear
$securityToken="[your guid here]"

$projectUrl="http://[your url here]/ontimesdk/projectservice.asmx"

$onTimeProject = New-WebServiceProxy $projectUrl -Namespace projects

$projectHandler = New-Object projects.ProjectHandler

$dataset = $projectHandler.GetAllProjects($securityToken)

foreach ($row in $dataset.Tables[0].Rows)
{
''+$row.ProjectId + ' - ' + $row.Name
}