Access Site Collection in Powershell with Client Id and Client Secret?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;







up vote
5
down vote

favorite












Is there a way to Create a context in powershell using Client Id and Client Secret ?



Currently I am using $context.Credentials in my code.










share|improve this question





























    up vote
    5
    down vote

    favorite












    Is there a way to Create a context in powershell using Client Id and Client Secret ?



    Currently I am using $context.Credentials in my code.










    share|improve this question

























      up vote
      5
      down vote

      favorite









      up vote
      5
      down vote

      favorite











      Is there a way to Create a context in powershell using Client Id and Client Secret ?



      Currently I am using $context.Credentials in my code.










      share|improve this question















      Is there a way to Create a context in powershell using Client Id and Client Secret ?



      Currently I am using $context.Credentials in my code.







      sharepoint-online powershell






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Sep 19 at 6:07









      Gautam Sheth

      22.6k12046




      22.6k12046










      asked Sep 19 at 5:59









      Joshua Dominic Sibug

      698




      698




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          5
          down vote



          accepted










          You can use PnP PowerShell to connect to SharePoint using client id as below:



          Connect-PnPOnline -Url <url> -AppId <clientid> -AppSecret <clientsecret>
          $context = Get-PnPContext


          Reference - Connect-PnPOnline



          Download - PnP PowerShell releases



          If you have PowerShellGet installed, you can directly install it using Install-Module SharePointPnPPowerShellOnline






          share|improve this answer




















            Your Answer







            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "232"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: false,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsharepoint.stackexchange.com%2fquestions%2f249206%2faccess-site-collection-in-powershell-with-client-id-and-client-secret%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            5
            down vote



            accepted










            You can use PnP PowerShell to connect to SharePoint using client id as below:



            Connect-PnPOnline -Url <url> -AppId <clientid> -AppSecret <clientsecret>
            $context = Get-PnPContext


            Reference - Connect-PnPOnline



            Download - PnP PowerShell releases



            If you have PowerShellGet installed, you can directly install it using Install-Module SharePointPnPPowerShellOnline






            share|improve this answer
























              up vote
              5
              down vote



              accepted










              You can use PnP PowerShell to connect to SharePoint using client id as below:



              Connect-PnPOnline -Url <url> -AppId <clientid> -AppSecret <clientsecret>
              $context = Get-PnPContext


              Reference - Connect-PnPOnline



              Download - PnP PowerShell releases



              If you have PowerShellGet installed, you can directly install it using Install-Module SharePointPnPPowerShellOnline






              share|improve this answer






















                up vote
                5
                down vote



                accepted







                up vote
                5
                down vote



                accepted






                You can use PnP PowerShell to connect to SharePoint using client id as below:



                Connect-PnPOnline -Url <url> -AppId <clientid> -AppSecret <clientsecret>
                $context = Get-PnPContext


                Reference - Connect-PnPOnline



                Download - PnP PowerShell releases



                If you have PowerShellGet installed, you can directly install it using Install-Module SharePointPnPPowerShellOnline






                share|improve this answer












                You can use PnP PowerShell to connect to SharePoint using client id as below:



                Connect-PnPOnline -Url <url> -AppId <clientid> -AppSecret <clientsecret>
                $context = Get-PnPContext


                Reference - Connect-PnPOnline



                Download - PnP PowerShell releases



                If you have PowerShellGet installed, you can directly install it using Install-Module SharePointPnPPowerShellOnline







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Sep 19 at 6:05









                Gautam Sheth

                22.6k12046




                22.6k12046



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsharepoint.stackexchange.com%2fquestions%2f249206%2faccess-site-collection-in-powershell-with-client-id-and-client-secret%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Popular posts from this blog

                    Peggy Mitchell

                    The Forum (Inglewood, California)

                    Palaiologos