cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

How to create newline in domain group description field via command line

BKroell
8-Gravel

How to create newline in domain group description field via command line

We plan to update our domain group description fields via script to note down the related item id for managing the group modification.

Unfortunately we can only create newlines via admin gui for the group description.

Name:

DomainGroup1234

Description:

Line1

Line2

Group Members:

TestUser:User

Via command line we don't know how to do this, everything in the description statement is put in one line:

> Integrity editmksdomaingroup --hostname=host --port=port --description="Line1"◙"Line2" DomainGroup1234

leads to:

Name:

DomainGroup1234

Description:

Line1?Line2

Group Members:

TestUser:User

I have tried replacing the newline characters with “\n” and the command works, but the description contains the “\n” and not a newline character. Do you have any idea how we can add newline characters into the group description with the commandline?

Regards,

Bertram

2014-08-14_13h53_36.png

3 REPLIES 3
KaelLizak
14-Alexandrite
(To:BKroell)

Hello Bertram,

Welcome to the community!

If you're trying to do this on a Windows workstation there is no trivial answer. As far as I can tell (I'm more of a Linux expert than a Windows expert) this is because there is no good way to escape the arguments. After some web searching, I believe these two articles seem to delve into this topic the best:

Fortunately, modern releases of Windows have a new CLI: PowerShell. If you try to do this in PowerShell, this should work:

integrity editmksdomaingroup --hostname=kvmcentos --user=kladmin --description="line1`r`nline2" analysts

If you're actually on a Unix-like workstation, this should be much easier. You should be able to do something like:

integrity editmksdomaingroup --hostname=kvmcentos --user=kladmin --description="`printf line1\nline2`" analysts

At least, I think you should. I haven't tested that.

Regards,
Kael


Kind Regards,
Kael Lizak

Senior Technical Support Engineer
PTC Integrity Lifecycle Manager
KomarlaK
4-Participant
(To:KaelLizak)

Hello Kael,

 

This seems to be like an old thread but I came across this issue again now. The below command didn't seem to work: integrity editmksdomaingroup --hostname=kvmcentos --user=kladmin --description="line1`r`nline2" analysts

 

This is what I tried: 

integrity editmksdomaingroup --description="line1`r`nline2" --hostname=host --port=port "kk Role Group"

 

I am using Windows 7 OS and Integrity 11 thick client. Let me know if you need any further information regarding this. 

 

Regards,

Karthik Komarla

 

 

Hi Karthik,

 

https://www.ptc.com/en/support/article?n=CS88685

 

I'd suggest opening up an Integrity support case for this, to check into this.  What shell are you using on Windows 7, for your Integrity system?

Depending on the shell used, some "hacky" CLI methods have been used, to get the Description value, populated with multi-line data, via the CLI command.

Ex.  Using cat to bring in a text file into the CLI command, or using Powershell variables.

 

The Support team should be able to assist you, in finding a method for you.

 

Mike C.

 

Top Tags