Comments (4)
If you look at the code in the Export script, currently, it will not clear the LineURI so only update with something else will work. Also looking at the code it should be able to clear ConferencingPolicy. What are the exact cmdlets to fire to clear these? May be we need a bit of revision to the code.
from mimpowershellconnectors.
I checked out the Invoke-SetCsUserCommand function and it contains really bad coding practices, the option of flowing Null has defenately been foreseen.
To start with, there is no reason what so ever building the command as a string for calling Invoke-Expression, splatting the parameters to the command would be far better and it would allow flowing null values.
As a quick fix for being able to clear the LineUri was to change this line that currently doesn't accept flowing null:
if ($lineURI -ne $null) { $cmd += " -LineURI '$lineURI'" }
...into:
if ($null -eq $lineURI) {$cmd += ' -LineURI $null'}else{ $cmd += " -LineURI '$lineURI'"}
The function Invoke-GrantCsPolicyCommands has an equally crappy implementation, string commands created and executed with Invoke-Command. For example if passing a null value using Invoke-Expression and this line:
if ($conferencingPolicyChanged) { $cmd += " | Grant-CsConferencingPolicy -PolicyName '$conferencingPolicy' -PassThru" }
...Will result in this when flowing Null:
Grant-CsConferencingPolicy -PolicyName '' -PassThru
...and not:
Grant-CsConferencingPolicy -PolicyName $null -PassThru
...We already have a fix for this and that was to add the default policy as a named policy and flow the name of that policy however that was before I realized these functions has such a crappy implementation.
Flowing null as ConferencingPolicy will of course give us an "exported-change-not-reimported" warning since the import will return an empty string and not Null however the biggest problem is that and empty string probably wont enable the default Policy.
I think both of these methods needs to be fixed with better coding practices and the possibility to flow null values where allowed.
from mimpowershellconnectors.
@Identitry, the current coding style is due to two design goals: 1. The codebase when written was meant for PowerShell 2.0, no splatting there. The other goal was to be able to debug on demand in a live production environment what exact command is being executed hence the creation of string first. You simply turn debugging on or on via the sync config file as and when there is a need for troubleshooting. Lot of things have changed over the years. Now the PowerShell connector shipped with the product works with .NET 4.5 and so supports PowerShell 3.0+, so you are welcome to upgrade the scripts with PowerShell 3.0+ capabilities as long as we can also meet the second goal as well. Let me know if you sign up for this and I'll add you as a contributor to the project, else I'll just close this issue now that you quick-fixed it for yourself.
from mimpowershellconnectors.
Hi, I'm closing this issue as waiting for someone to invest their time to do script upgrade to PSH 3.0 and beyond if they are strongly convinced that there is definite ROI on this effort.
from mimpowershellconnectors.
Related Issues (20)
- All users filtred when importing HOT 3
- Lync Connector HOT 6
- Lync Connector questions HOT 1
- LyncConnector Export script bug HOT 1
- Skype to AD Attribute Mapping HOT 2
- MarkDown type in Wiki HOT 1
- Illegal LDAP characters not escaped HOT 3
- Cannot perform Multi-step run profile HOT 9
- Question about logging HOT 4
- Dev to Prod Migratoin Issues - Partition and Containers HOT 1
- Password Extension Script is not properly invoked unless certain other scripts are specified
- Prefered DC not set when exporting policies.
- MIM Powershell MA Error Report
- Import fails when an included OU has been removed from AD HOT 3
- Home Drive Provisioning HOT 1
- missing-dn while running Full Import HOT 3
- Skype Export sometimes hangs and requires miiserver.exe to be forced killed
- Error when running Exchange Scripts
- This repo is missing important files
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 mimpowershellconnectors.