Change User Regional Setting to “Always follow Web” using PowerShell

I have written this PowerShell script which is related to user regional setting. This below-mentioned code block will help us to change user regional setting to “always follow web” regional setting. [code lang=”c”] Write-Host -ForegroundColor cyan ‘Please provide the site url’ $SiteURL = Read-Host “Site Url” try { Add-PSSnapin “Microsoft.SharePoint.PowerShell” $SPsiteURL = Get-SPSite $SiteURL $SPserviceContext = Get-SPServiceContext $SPsiteURL $SPweb = […]

Crud Operations on a List

This code block is related to create, delete, update and add list items to a custom list. [code lang=”c”] using System; using Microsoft.SharePoint.Client; using System.Security; namespace List_Crud_Operations { class Program { static void Main(string[] args) { ClientContext ctx = new ClientContext(“http://portal/sites/site1”); Web web = ctx.Web; var password = “Password”; SecureString secureString = new SecureString(); foreach (char c in password.ToCharArray()) secureString.AppendChar(c); […]

How to Inject your Custom JavaScript in Modern Pages on Page Load

This SPFx functionality helps to inject your custom JavaScript file in your modern site pages on page load. [code lang=”c”] export default class MySPFXApplicationCustomizer extends BaseApplicationCustomizer<IMySPFXApplicationCustomizerProperties> { private _customJsUrl: string = “https://sharepointdomain.net/scripts/MyCustonScript.js”; @override public onInit(): Promise<void> { let scriptTag: HTMLScriptElement = document.createElement(“script”); scriptTag.src = this._customJsUrl; scriptTag.type = “text/javascript”; document.getElementsByTagName(“head”)[0].appendChild(scriptTag); return Promise.resolve<void>(); } } [/code] This solution is brought to you […]

Get members from Office 365 Azure Ad using Graph API

1.Create a WPF application 2. Add the below mentioned code in the App.xaml.cs page. [code lang=”c”] private static string ClientId = “0b8b0665-bc13-4fdc-bd72-e0227b9fc011″; private static PublicClientApplication _clientApp ; public static PublicClientApplication PublicClientApp { get { return _clientApp; } } static App() { _clientApp = new PublicClientApplication(ClientId); }[/code] 3.In mainwindow.xaml Add a button for calling the graph and a multiline textbox to […]