Month: June 2016

Suppose you need to create a mailto-link with subject and body but the body should contain few lines of a blank text right after staring text and before ending text, like on this screenshot:
<screenshot>
Let’s compile the link:
“mailto:email@domain.com
?

subject=Subject *here we can also use URLencode – %3Project name%3E appears to be <Project name>
&

body=Body,%3Cyour text%3E%0A%0D%0A%0D%0A%0D%0A%0D%3Cyour text%3E”
Here URLencode is also coming for help.
LF (line feed) can be encoded as %0A, and CR (carriage return) – as %0D, allowing to create few blank lines betweent text.

include in a different PS1 file, and then “dot source” that file to include it in the current scope:

. D:\script_common\MyCode.ps1

then launch functions from script above
or

To write your own modules in Powershell, you name the module with a .psm1 extension. Typically, you don’t do free floating code in one of these; you write functions which are then available to the code which imports the module.

#
SPApplicationAuthenticationModule: Failed to authenticate request, unknown error. Exception details: System.IdentityModel.Tokens.SecurityTokenException: The issuer of the token is not a trusted issuer.
Application error when access /_api/search/query, Error=The issuer of the token is not a trusted issuer.

#
Check for certificate (TrustedRootAuthority)
Check for correct usage og ClientId and IssuerId on add-in side (registration, New-SPTrustedSecurityTokenIssuer) and the opposite side – when creating JWT token and signing it
#
Application error when access /_api/search/postquery, Error=3001002;reason=The incoming identity is not mapped to any user profile account in SharePoint. Possible cause is that no user profiles are created in user profile database. Contact your administrator.

06/21/2016 17:02:26.68 w3wp.exe (0x2FD0) 0x01F8 SharePoint Foundation Claims Authentication 8306 Critical An exception occurred when trying to issue security token: Operation is not valid due to the current state of the object.. 1c57889d-7fb0-d015-1370-d106e146439d

#

Check and add user account to call (app only not working for search queries)