I'm having issues with the Account.Retrieve() SSJS core function. I was previously able to use this code to retrieve all Business Units in an Enterprise account:
<script runat=server>
Platform.Load('core', '1');
var filter = {
Property: 'Name',
SimpleOperator: 'NotEquals',
Value: null,
QueryAllAccounts: true
};
var getBUs = Account.Retrieve(filter);
Write(Stringify(getBUs));
</script>
While this script works in some enterprise accounts, it is now returning an empty array in other accounts. It used to work consistently across all Marketing Cloud accounts. I've tried changing the filter to include a BU name or MID, but it's still empty. I'm wondering if anyone else has experienced this and can suggest a workaround?
equals
but also assumes nothing, likefilter = { Property: 'IsActive', SimpleOperator: 'equals', Value: '1', QueryAllAccounts: true};