Logging onto the ChangeBASE Service

In order to issue commands to the ChangeBASE service you must first logon (or authenticate). There is a built-in function to do this.

In order to logon on to the ChangeBASE service you will need the following information:

  • $CBServerAddress
    • This is the name of the server that the ChangeBASE service is hosted on. If this is the local machine where the PowerShell script is being executed, it can be ignored as the default value is "localhost"
  • $RepositoryID
    • This is the identifier of the repository or database you wish to connect to. If you have only a single database this will be "1"; if you are unsure of the repository identifier, it can be can be found on the machine running the ChangeBASE service by examining the %programdata%\ChangeBASE\repositories.xml noting the value of “id” for the required repository
  • $UserDomain
    • This is the domain of the user you wish to connect as, and would be the domain or workgroup name of a user who runs the ChangeBASE client. This parameter defaults to $env:USERDOMAIN
  • $Username
    • This is the username of the user you wish to connect as, and would be the logged on username of a user who runs the ChangeBASE client. This parameter defaults to $env:USERNAME

 At the PowerShell command prompt execute the following command:

Connect-CB $ServiceAddress $RepositoryId $UserDomain $Username

 If the logon is successful the function will return "1", if it is unsuccessful it will return "0".