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
4
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
    4
    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
      4
      down vote

      favorite









      up vote
      4
      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 28 mins ago









      Gautam Sheth

      22.2k12046




      22.2k12046










      asked 35 mins ago









      Joshua Dominic Sibug

      648




      648




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          4
          down vote













          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
            4
            down vote













            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
              4
              down vote













              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
                4
                down vote










                up vote
                4
                down vote









                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 29 mins ago









                Gautam Sheth

                22.2k12046




                22.2k12046



























                     

                    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













































































                    Comments

                    Popular posts from this blog

                    What does second last employer means? [closed]

                    Installing NextGIS Connect into QGIS 3?

                    One-line joke