Posts

Showing posts from 2021

Power Apps Sort Alphabetically

 Collect(AllTags, 'list1'.'Tag Number', 'list2'.'Tag Number', list3.'Tag Number'); ClearCollect(disticntSortTags,     Distinct(         Sort( AllTags, Tag_x0020_Number, Ascending ) , Tag_x0020_Number)) Contact us now for more help developing great Power Apps!

microsoft flow (power automation) test if lookup is empty

 You need to use "empty" expression on the Lookup Value and Condition equals to expression "true" (of false or not equal ect.)

SFPx Node-Saas Error

 If you get this kind of error Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime (83) or any other kind of gulp build errors, and if its after you upgraded to Node 14.X, and upgraded your YO generator, then its because all the dependencies changed, and you need to migrage. so here is a simple solution: 1. Create a side clean SPFx project (Webpart or Extension (Extension is only with 2019+)) 2. Save somewhere (just in case) the following files  package.json, tsconfig.json, package-lock.json 3. Copy from your new project to your old project only 2 files   package.json, tsconfig.json * change the name and version of your project in the package.json file 4. Run gulp clean 5. Run npm install 6. Run gulp build ect. Do you need an SPFx Developers? Contact us now!

Sharepoint Online List Item Edit Display Forms link

 /sites/Portal/Lists/List10/DispForm.aspx?ID=4 /sites/Portal/Lists/List10/EditForm.aspx?ID=4

SharePoint Online/2019 javascript/spfx click/popstate not working

Image
Are you working with SharePoint 2019? Maybe making some SPFx Extensions?  popstate not working?  click not working?  MutationObserver not working?  well, take a look at this As you can see, Microsoft are intercepting every click in the page, while stopping any bubbling. Therefor, any window/document/body onclick event will not work, in case you are trying to globally catch it. Same for popstate or MutationObserver. *Note - on SPO it seems that popstate event works. Solution - make an interval to keep watching href change: let   xPrevLocation  =  location . href let   xOnLocationChangeFunctions  = [] setInterval (() => {      if  ( location . href  !=  xPrevLocation ){          console . log ( "interval location change" ,  xPrevLocation ,  location . href )          xPrevLocation  =  location . href          for  ( let   i = 0 ;  i < xOnLocationChangeFunctions . length ;  i ++){              xOnLocationChangeFunctions [ i ]();         }     } },  350 ) Usage: window [ &#

debugManifestsFile Error

  Error loading debug script. Ensure the server is running and the "debugManifestsFile" parameter URL is correct. Error: Script error for " https://localhost:4321/temp/manifests.js " SOLUTION browse to  https://localhost:4321/temp/manifests.js  and allow to proceed to unsafe, and refresh the original page

SPFx with Angular, Full tutorial

 White you can use the pnp-generator , I really wanted to created this kind of solution all by myself, since I also wanted to implement it with SP-2019, with SFPx 1.4.x Part 1: Setup I started with a clean machine, installed LTS node 14.17.0 , and installed latest gulp, yo, sp-generator for yo, and angular-cli command: npm install gulp yo @microsoft/generator-sharepoint --global results: + gulp@4.0.2 + yo@4.2.0 + @microsoft/generator-sharepoint@1.12.1 command: npm install -g @angular/cli results: + @angular/cli@12.0.2 *NOTE - To the time of writing, I had an error generating browser application bundles so I downgraded to angular 10.x, and re-create the project npm uninstall -g @angular/cli npm cache clean --force npm install -g @angular/cli@10.2.0 And so our journey begins! Create new Ng project ng new ng-for-spfx-ex Create new SPFx WebPart Project - just  yo Part 2: Test NG with SPFx Within the  angular.json   file lets change the output path, I've made 1 folder, within I created

Windows run as a different user from CMD

 On my journey to fix my dev env I learned some cool trick on how to run stuff in windows as another user, from CMD * For running the .exe files you need to navigate to their folders or run full path The basic operation to run as user is runas /netonly /user:<DOMAIN>\<USER> <COMMAND> So, for example domain is MyDom, and user is OthrUsr - Just open CMD runas /netonly /user:MyDom\OthrUsr cmd - Open PowerShell cd "C:\Windows\System32\WindowsPowerShell\v1.0\" runas /netonly /user: MyDom\OthrUsr  PowerShell.exe - Open SharePoint PowerShell cd "C:\Windows\System32\WindowsPowerShell\v1.0\" runas /netonly /user: MyDom\OthrUsr  PowerShell.exe . "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\CONFIG\POWERSHELL\Registration\SharePoint.ps1" *According to your SP version the "16" might be 15 (for sp13) or 14 (for sp10) - Open SQL Server Management Studio (SSMS)  (path can chage according to version) cd "C:\Progr

new SharePoint 2019 machine - cant login into SQL Server

 We have created a newly win2k16 server with sharepoint 2019, and it worked great... Until I tried to enable apps (SPFx), and I needed to create a Subscription Service, and therefor use the SQLSERVER. Whatever I tried I got these error depending on the test, with PowerShell commands (PS), SQL logs, or Sql Server Management Studio (SSMS). Error: 18456, Severity: 14, State: 5. Login failed for user '<DOMAIN>\<USER>'. Reason: Could not find a login matching the name provided. [CLIENT: <local machine>] Error: 18461, Severity: 14, State: 1. Login failed for user '<DOMAIN>\<USER>'. Reason: Server is in single user mode. Only one administrator can connect at this time. [CLIENT: <local machine>] Error: 18456, Severity: 14, State: 58. Login failed for user '<DOMAIN>\<USER>'. Reason: An attempt to login using SQL authentication failed. Server is configured for Windows authentication only. [CLIENT: <local machine>] In t

Setting new SP2019 dev machine for SPFx

I've made this collection for any other time me or you will get a new SP machine for local dev. Create your Web-App and change the hosts file with new value 127.0.0.1 my-webapp Make browser stop asking for credentials endlessly https://sharepoint.stackexchange.com/questions/11792/external-access-continually-prompted-for-credentials#answer-11846 Sometimes you want to enable multi rdp (not multi user, just multi sessions for same user) https://social.technet.microsoft.com/Forums/en-US/c52b6da7-cdf2-4e1f-95d1-6471c6f2f6b0/easiest-way-to-enable-more-than-2-concurrent-rdp-sessions-on-windows-server-2016?forum=winserverTS#1701fa1f-c7fb-4093-a525-8b188e17c440 OR https://help.matrix42.com/020_ESM/MyWorkspace/10MyWorkspace_Guide/HowTo%3A_Enable_multiple_sessions_for_Remote_Desktop_Services#:~:text=Enable%20Multiple%20RDP%20Sessions,-Log%20into%20the&text=Go%20to%20Computer%20Configuration%20%3E%20Administrative,Desktop%20Services%20session%20to%20Disabled. And in that case, enable open

SPFx migrating solution from Online to 2019

 Let me start that is would be much easier to just create a new solution, specify it as an 2019 and copy the code. But I'm an explorer type of man... So I did created another solution for 2019 and copied some files tsconfig.json package.json package-lock .yo-rc.json under /config , I matched the content of those files (dont copy-paste) copy-assets.json package-solution.json Also in all /src/webparts/<someWP>/<someWP>.manifest.json mark this line "supportedHosts" : [ "SharePointWebPart" ], And finally in your code dont use stuff like  public   listDetails :[]=[]  instead just  public   listDetails =[]

SPFx: Can't view Install Errors

Simple solution is to disable "DenyAddAndCustomizePages" to just enable those pages for the site collection NOTICE - its site collection level $tenantUrl = "https://<tenant>-admin.sharepoint.com" Connect-SPOService -Url $tenantUrl $siteUrl = "https:// <tenant> .sharepoint.com/sites/teamsiteexample" Set-SPOSite -Identity $siteUrl -DenyAddAndCustomizePages $false Disconnect-SPOService  You can always change it back to $true

Narnia 1 - OverTheWire - Updated Walktrough

Narnia 1 is about teaching you to write, inject and use ShellCode. *NOTE - this tutorial is for programmers like me, that just learn some web programming, maybe having fun with some hacking ect., no idea about c or assembler. If you're a computer science deg. this might be wwaayy over simplifying, and therefor its not for you. The main purpose of this tutorial is not HOW to solve narnia1, but to UNDERSTAND how to solve it a-z. What's ShellCode? Its a crafted piece of code, usually meant for a shell, usually binary code (in hex representation, called Object Code) So as stated there are 3 stages here, -write, -inject, -run. I'll start from the last. RUN YOUR SHELLCODE Well, in order to run your shellcode, you need to know where is the exploit, and adapt the code to that, so lets open narnia and lets see the exlpoit in " narnia1.c ":     ret = getenv("EGG");     ret(); Well, whats " ret "? It is defined " int (*ret)(); "

CTF365 Security Shepherd Walkthrough - No Spoilers Just Hints

hopefully, lets try to do all of the  CTF365 Security Shepherd  lessons and challenges, and help everybody with all they need but no spoilers. that doens't meant you don't need to do your learning, if i didn't write something, that means (a) learn the topic (b) read instructions. simple way to work through is installing burp-suite CE and make it work with ssl, but i'll try to also teach, where possible, you can use other tools. LESSONS *any lession with a asterisk [*] in its name means that it would have been easier with burp, just altering the request. [need to install cert. etc.] Broken Session Management* the session is managed via cookies, can be changed via Chrome Dev Tools (F12) -> Application tab -> Storage -> Cookies. (maybe you must click the button 1st) Cross-Site Request Forgery after putting a value in the box and submitting, right-click and Inspect-Element the image. you must put a full url i.e. https://..... try put a funny image

Copy SharePoint Online List with Data (with list items) to another site

 We have PNP!!! Using this post , and upgrading it with to the new PNP , this is the results 1. Make variable $listName = "listTitle" (hebrew works :)) $listName = "קריאות לבאטמן" 2. Make variable $templateName = "c:\template\HR-listTemplate" (or another path) $templateName = "c:\template\BAT-listTemplate" 3. Connect to SiteA Connect-PnPOnline -Url "https://tenant.sharepoint.com/sites/SiteX/SiteA" 4. Get list template Get-PnPSiteTemplate -Handlers Lists -ListsToExtract $listName -Out ("{0}.xml" -f $templateName) 5. Get items to that same file (peep to the xml file) Add-PnPDataRowsToSiteTemplate -path ("{0}.xml" -f $templateName) -List $listName -Query '<view></view>' 6. Connect to SiteB Connect-PnPOnline -Url "https://amymetom1.sharepoint.com/sites/AmyPortal2" 7. Provision the list Invoke-PnPSiteTemplate -Path ("{0}.xml" -f $templateName)  8. Go to site content and be pr

SharePoint Modern Site copy/save Theme to another site

In case you Provisioned a beautiful site with the PNP services of SharePoint LookBook , and you liked it, but wanted to take it out to another site... Well, MS did not yet gave us a way to save/copy a Theme... just a lot of ways to upload ones... I tried so mush downloading a site template with Get-PnPProvisioningTemplate Get-PnPSiteTemplate Invoke-PnPSiteTemplate All failed for so many reasons... BTW (1) dont change the name of the .pnp file, and if you get some "access denied" error, either become global admin, or use "-ExcludeHandlers" (i needed  Fields, Files, Lists, Pages ) Anyways... how I got it working 1. I used this endpoint to get the actual palette https://tenant.sharepoint.com/sites/NewEmployeeOnboardingNew/_api/SP.Web.GetContextWebThemeData 2. And extraced the data accroding to this MS article  while converting the RGB to HEX code made in html/js in the end 3. I uploaded the theme to the Tenant With SPO services, for some reason, you can't connec

CPanel - WHM - change sending email via server to email Relay (email supplier SMTP) (mailgun)

Following this article https://www.smtp2go.com/setupguide/exim_whm_cpanel/ While choosing mailgun as my supplier, and the help of one of GNS experts, here is what you need to do.  NOTICE this is for SMTP. Open your WHM, in the left search for "Exim" and click "Exim Configuration Manager". Within the new window opened there are some tabs, choose "Advanced Editor". Its Highly recommended that you save the old values for each place you make a change. 1. Find the area under begin authenticators Section: AUTH   and paste these values: mailgun_login:  driver = plaintext  public_name = LOGIN  hide client_send = : postmaster@mydomain.co.il:9b7. ...e3 change the last line to your email account name and your password 2. Find the area under Section: ROUTERSTART and paste these values: mailgun:  driver = manualroute  domains = ! +local_domains  transport = mailgun_transport  route_list = "* smtp.eu.mailgun.org::587 byname"  host_find_failed = defer  no_more

SPFx gulp bundle --ship Error - 'undefined' errored after "orchestration aborted"

 Using SPFx fro Application Customizer for SharePoint 2019. Did gulp bundle --ship. Error - 'undefined' errored after orchestration aborted" Resolve: move out the TS Type [] Problem:      public   MegaMenuListData :[] = []; Solution:      public   MegaMenuListData  = [];

Correct way to set Sharepoint calculated field for Month

 - the bad solution "if(Month(TODAY())=Month([ Created]))" The good solution FIELD "start the month"- returns this date:  =DATE(YEAR([Created]), MONTH([Created]),1)  FIELD " end the month"- returns this    =DATE(YEAR([Created]),MONTH([ Created])+1,1)-1

SharePoint Search move to another page with same Query and Filters

Image
NOTE: this is classic SP, meaning 2013, or classic experience in 365, classic sites, or in my case, Publishing Site Collection, even on O365 - SP Online.  Scenario: I have a search page, for our randomly designed search results, with filters and paging, so far so good, SP provides everything except the design, for that we play with our design templates. Now our darling customer asks us to make a dynamic page for our singe item result.  Usually either we build a page-based system, and the results are pages, or even with documents-based system, usually we click on the docs and open them. In our case we had documents, in a  Documents Library (where else?), with some columns, and when we click on a result we go to a customized page that projects the metadata (columns) to that page. Again, so if we get a result for a PDF or Image, we now open another .aspx page, there we show the Title and Thumbnail and Description and so on of the file, most of them just more fields in the Documents Librar