Comments (4)
Hi.
I took it upon myself to fix this issue, i dont want to commit the change but i have created an easy code replace for the finnished .ps1 file, this might not be the best way to fix this but it works.
When you generate through his generator just enter multiple groups with a comma(,) as delimiter eg. "Group1,Group2" do not put any space around the comma.
Then replace this row
$driveMappingConfig = $driveMappingConfig | Where-Object { $groupMemberships -contains $_.GroupFilter -or $_.GroupFilter -eq $null }
with this code:
$driveMappingConfigCleaned = @() foreach ($mapping in $driveMappingConfig) { if($mapping.GroupFilter -ne $null -and $mapping.GroupFilter.Contains(",")) { $Agroups = $mapping.GroupFilter.Split(",") foreach ($Agroup in $Agroups) { if ($groupMemberships -contains $Agroup) { $mapping.GroupFilter = $Agroup $driveMappingConfigCleaned += $mapping break } } } else { if ($groupMemberships -contains $mapping.GroupFilter -or $mapping.GroupFilter -eq $null) { $driveMappingConfigCleaned += $mapping } } } $driveMappingConfig = $driveMappingConfigCleaned
from intunedrivemapping.
A different approach that uses Compare-Object instead.
$driveMappingConfigCleaned = @() foreach ($mapping in $driveMappingConfig) { if($mapping.GroupFilter -ne $null -and $mapping.GroupFilter.Contains(",")) { $Agroups = $mapping.GroupFilter.Split(",") $value = Compare-Object -ReferenceObject $Agroups -DifferenceObject $groupMemberships -IncludeEqual -ExcludeDifferent -PassThru if($value.Count -gt 0) { $driveMappingConfigCleaned += $mapping } } else { if ($groupMemberships -contains $mapping.GroupFilter -or $mapping.GroupFilter -eq $null) { $driveMappingConfigCleaned += $mapping } } } $driveMappingConfig = $driveMappingConfigCleaned
from intunedrivemapping.
I also added a pull request quite a time ago. You can see my code there. But it seems like this repo won't get updated anymore.
from intunedrivemapping.
from intunedrivemapping.
Related Issues (20)
- Allow updating script in editor HOT 2
- MapNetworkDrive connect using different credentials HOT 2
- The (member:1.2.840.113556.1.4.1941:=) search filter is invalid. HOT 3
- Question: Old script renamed to DriveMappping.ps1 HOT 3
- Script not detecting that it is running as system HOT 3
- Multiple Security Group HOT 4
- Hidden Drive Support
- Drive Label not Expand correctly
- Drives will be unmapped if Membership could not retrieved
- Support for Azure storage accounts?
- Username/Password
- Performance issues with DriveMapping Script
- Remove script from task scheduler HOT 1
- Script does not have logic to re-map a network drive when a UNC path is changed HOT 5
- Drives map when task run manually but not when triggered
- How to add to the script removing all mapped drives before mapping them HOT 1
- Getting below error while running the script HOT 1
- NOT option for groups?
- Addressing %USERNAME%, and various file servers on the script?
- execution restriction preventing drive maps of being added HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from intunedrivemapping.