Skip to main content

It's not creating the AD group. I'm not sure what is the problem. When I get the status of the job_id it shows below.

<Job#dae06783-46c2-4b62-87c1-a914f5714d5f GroupImport created_at(2022-03-08 11:01:19+00:00) started_at(None) completed_at(2022-03-08 11:01:19+00:00) progress (100) finish_code(1)>

 

My code:

#Import packages

import tableauserverclient as TSC

 

# Make connection with Tableau Serevr

tableau_auth = TSC.PersonalAccessTokenAuth('signin', 'abc', 'abc')

server = TSC.Server('http://tableausite', use_server_version=True)

 

# Create group & assign a miminum site role

with server.auth.sign_in(tableau_auth):

    # create a new instance with the group name

 

    newgroup = TSC.GroupItem('Tableau-VIEWER','corp.athenahealth.com')

    newgroup.minimum_site_role = TSC.UserItem.Roles.Unlicensed

    newgroup.license_mode = TSC.GroupItem.LicenseMode.onLogin

 

    # call the create method

    newADgroup = server.groups.create_AD_group(newgroup, asJob=True)

    print(newADgroup)

 

    jobinfo= server.jobs.get_by_id('dae06783-46c2-4b62-87c1-a914f5714d5f')

    print(jobinfo)

 

Also, whenever I pass asJob parameter "False" it throws error.

in wrapper  return func(self, *args, **kwargs)

 

But same thing I could do using Postman API. The only thing I'm trying to do is pass multiple ad groups to be imported using above script. But currently not able to do for a single ADgroup as well.

 

newADgroup = server.groups.create_AD_group(newgroup, asJob=True)

    print(newADgroup)

5 answers
0/9000