How do you tell if an Attachment is encrypted

Victor43
Tera Contributor

Hi,

Does anyone know how to query the sys_attachment table to tell if an attachment is encrypted or not?  Is there another table that needs to be looked at?

Thanks,

Victor

5 REPLIES 5

Sujatha V M
Kilo Patron
Kilo Patron

@Victor43  Please refer the link below, 

 

servicenow.com/community/now-platform-forum/i-want-to-check-attachment-is-passworded-or-not/m-p/1174...

 

Other optional links : 

 

https://docs.servicenow.com/bundle/washingtondc-platform-security/page/administer/encryption/concept...

 

https://docs.servicenow.com/bundle/washingtondc-platform-user-interface/page/administer/workspace/ta...


Please mark this as helpful and accept it as a solution if this resolves your query.

Thanks,

Sujatha V.M.

Please mark this as helpful and accept it as a solution if this resolves your query.
Sujatha V.M.

This is unhelpful.

Jitendra Diwak1
Kilo Sage

Hi @Victor43,

 

To check if an attachment is encrypted in ServiceNow via script, you can use GlideSysAttachment API. Here's a sample script:

 

```javascript

var attachmentSysId = 'attachment_sys_id_here'; // Replace 'attachment_sys_id_here' with the sys_id of the attachment you want to check

 

var attachmentGR = new GlideRecord('sys_attachment');

if (attachmentGR.get(attachmentSysId)) {

    if (attachmentGR.isEncrypted()) {

        gs.info('Attachment is encrypted.');

    } else {

        gs.info('Attachment is not encrypted.');

    }

} else {

    gs.info('Attachment not found.');

}

```

 

This script checks if the attachment with the specified sys_id is encrypted or not. If it is encrypted, it logs a message saying so; otherwise, it logs that the attachment is not encrypted.

 

Please accept my solution if it resolves your issue and thumps 👍 up 

 

Thanks 

Jitendra 

Please accept my solution if it works for and thumps up.

NO, THIS IS NOT HELPFUL!

YOU JUST ASKED A GPT, WHICH HALLUCINATED, AND YOU NEVER CHECKED YOUR ANSWER.

IT'S SAD THAT THERE'S NO "UNHELPFUL"  BUTTON HERE.